update interface: ProblemConfig

This commit is contained in:
undefined committed 2020-07-24 17:22:59 +08:00
1 parent 92335d8529
commit 57881792f3
15 files changed
+226 -145

No files matched your search

+6 -1
View File
@@ -10,6 +10,8 @@ import fs from 'fs-extra';
import { argv } from 'yargs';
import AdmZip from 'adm-zip';
export * from './interface';
global.Hydro = {
stat: { reqCount: 0 },
handler: {},
@@ -65,7 +67,10 @@ async function entry(config: EntryConfig) {
const sargv = [`--entry=${config.entry}`];
const p = await fork(sargv);
await new Promise((resolve, reject) => {
p.on('exit', resolve);
p.on('exit', (code, signal) => {
if (code === 0) resolve();
else reject(signal);
});
p.on('error', (err: Error) => {
p.kill();
reject(err);