File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 11import * as cp from 'child_process' ;
22import { once } from 'events' ;
3- import { join , sep } from 'path' ;
3+ import { join } from 'path' ;
44
55import { exists } from './utils' ;
66
@@ -46,7 +46,8 @@ export class Package {
4646 this . library = match [ 1 ] as 'bson' | 'bson-ext' ;
4747
4848 this . localPath = match [ 2 ] ;
49- this . computedModuleName = `${ this . library } -local-${ this . localPath . replaceAll ( sep , '_' ) } ` ;
49+ const cleanedLocalPath = this . localPath . replaceAll ( '/' , '_' ) . replaceAll ( '\\' , '_' ) ;
50+ this . computedModuleName = `${ this . library } -local-${ cleanedLocalPath } ` ;
5051 } else {
5152 throw new Error ( 'unknown package specifier' ) ;
5253 }
Original file line number Diff line number Diff line change @@ -194,10 +194,12 @@ export class Task {
194194 this . children . push ( child ) ;
195195
196196 // listen for results or error
197- const resultOrError : ResultMessage | ErrorMessage = ( await once ( child , 'message' ) ) [ 0 ] ;
197+ const resultOrErrorPromise = once ( child , 'message' ) ;
198+ // Wait for process to exit
199+ const exit = once ( child , 'exit' ) ;
198200
199- // wait for child to close
200- await once ( child , ' exit' ) ;
201+ const resultOrError : ResultMessage | ErrorMessage = ( await resultOrErrorPromise ) [ 0 ] ;
202+ await exit ;
201203
202204 this . hasRun = true ;
203205 switch ( resultOrError . type ) {
You can’t perform that action at this time.
0 commit comments