feat: 完善图像工作区与创作工具体验
This commit is contained in:
25
scripts/run-cloud-image-workspace-dev.mjs
Normal file
25
scripts/run-cloud-image-workspace-dev.mjs
Normal file
@@ -0,0 +1,25 @@
|
||||
import { spawn } from 'node:child_process';
|
||||
import { resolve } from 'node:path';
|
||||
|
||||
const viteEntry = resolve(process.cwd(), 'node_modules/vite/bin/vite.js');
|
||||
const child = spawn(process.execPath, [viteEntry, ...process.argv.slice(2)], {
|
||||
stdio: 'inherit',
|
||||
env: {
|
||||
...process.env,
|
||||
NIANCODE_IMAGE_WORKSPACE_MODE: 'cloud',
|
||||
},
|
||||
});
|
||||
|
||||
for (const signal of ['SIGINT', 'SIGTERM']) {
|
||||
process.on(signal, () => {
|
||||
child.kill(signal);
|
||||
});
|
||||
}
|
||||
|
||||
child.on('exit', (code, signal) => {
|
||||
if (signal) {
|
||||
process.kill(process.pid, signal);
|
||||
return;
|
||||
}
|
||||
process.exitCode = code ?? 1;
|
||||
});
|
||||
Reference in New Issue
Block a user