30 lines
822 B
Bash
Executable File
30 lines
822 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
node --input-type=module <<'NODE'
|
|
import fs from 'node:fs';
|
|
|
|
const readJson = (path) => JSON.parse(fs.readFileSync(path, 'utf8'));
|
|
const checks = {
|
|
packageVersion: readJson('/app/package.json').version,
|
|
hasCli: fs.existsSync('/app/cli.js'),
|
|
hasIndex: fs.existsSync('/app/dist_ts/index.js'),
|
|
hasRendertronClass: fs.existsSync('/app/dist_ts/rendertron.classes.rendertron.js'),
|
|
};
|
|
|
|
if (checks.packageVersion !== '2.0.62') {
|
|
throw new Error(`Unexpected corerender package version ${checks.packageVersion}`);
|
|
}
|
|
if (!checks.hasCli) {
|
|
throw new Error('Missing cli.js');
|
|
}
|
|
if (!checks.hasIndex) {
|
|
throw new Error('Missing dist_ts/index.js');
|
|
}
|
|
if (!checks.hasRendertronClass) {
|
|
throw new Error('Missing rendertron class output');
|
|
}
|
|
|
|
console.log(JSON.stringify(checks));
|
|
NODE
|