slopus--happy
98e40dac97
CLI Smoke Test / smoke-test-linux (20) (push) Has been cancelled
CLI Smoke Test / smoke-test-linux (24) (push) Has been cancelled
CLI Smoke Test / smoke-test-windows (20) (push) Has been cancelled
CLI Smoke Test / smoke-test-windows (24) (push) Has been cancelled
Expo App TypeScript typecheck / typecheck (push) Has been cancelled
33 行
774 B
JavaScript
可执行文件
33 行
774 B
JavaScript
可执行文件
#!/usr/bin/env node
|
|
'use strict';
|
|
|
|
const { spawn } = require('node:child_process');
|
|
const { resolveServerArtifact } = require('../index.cjs');
|
|
|
|
const artifact = resolveServerArtifact();
|
|
if (!artifact) {
|
|
console.error('Could not locate the Happy server package runtime.');
|
|
process.exit(1);
|
|
}
|
|
|
|
const env = { ...process.env };
|
|
if (artifact.webappDir && !env.HAPPY_STATIC_DIR) {
|
|
env.HAPPY_STATIC_DIR = artifact.webappDir;
|
|
}
|
|
|
|
const child = spawn(artifact.command, [...artifact.prefixArgs, ...process.argv.slice(2)], {
|
|
cwd: artifact.cwd,
|
|
env,
|
|
stdio: 'inherit',
|
|
});
|
|
|
|
child.on('error', error => {
|
|
console.error(error.message);
|
|
process.exit(1);
|
|
});
|
|
|
|
child.on('exit', (code, signal) => {
|
|
if (signal) process.kill(process.pid, signal);
|
|
process.exit(code ?? 0);
|
|
});
|