code 💄

This commit is contained in:
Benjamin Pasero
2020-10-05 08:06:13 +02:00
parent e642dd27b3
commit 38a3d69caf
10 changed files with 30 additions and 32 deletions
+4 -4
View File
@@ -138,7 +138,7 @@ export async function main(argv: string[]): Promise<any> {
child.stdout!.on('data', (data: Buffer) => console.log(data.toString('utf8').trim()));
child.stderr!.on('data', (data: Buffer) => console.log(data.toString('utf8').trim()));
await new Promise<void>(c => child.once('exit', () => c()));
await new Promise<void>(resolve => child.once('exit', () => resolve()));
});
}
@@ -332,13 +332,13 @@ export async function main(argv: string[]): Promise<any> {
const child = spawn(process.execPath, argv.slice(2), options);
if (args.wait && waitMarkerFilePath) {
return new Promise<void>(c => {
return new Promise<void>(resolve => {
// Complete when process exits
child.once('exit', () => c(undefined));
child.once('exit', () => resolve(undefined));
// Complete when wait marker file is deleted
whenDeleted(waitMarkerFilePath!).then(c, c);
whenDeleted(waitMarkerFilePath!).then(resolve, resolve);
}).then(() => {
// Make sure to delete the tmp stdin file if we have any