ethercalc
Version:
Multi-User Spreadsheet Server — TypeScript rewrite (Cloudflare fullstack)
31 lines (24 loc) • 871 B
JavaScript
const { spawnSync } = require('node:child_process');
const { existsSync } = require('node:fs');
const path = require('node:path');
const packageRoot = path.resolve(__dirname, '..');
if (existsSync(path.join(packageRoot, '.git'))) process.exit(0);
const env = { ...process.env };
delete env.CI;
const result = spawnSync('bun', ['install', '--production', '--ignore-scripts'], {
cwd: packageRoot,
env,
stdio: 'inherit',
});
if (result.error?.code === 'ENOENT') {
console.error(
"ethercalc: Bun is required but was not found on PATH. Install Bun (https://bun.sh), then run 'bun install --production --ignore-scripts' in the package root.",
);
process.exit(1);
}
if (result.error) {
console.error(`ethercalc: failed to install runtime dependencies: ${result.error.message}`);
process.exit(1);
}
process.exit(result.status ?? 1);