@@ -20,7 +20,6 @@ import { getDependencies } from './npm';
20
20
const readFile = denodeify < string , string , string > ( fs . readFile ) ;
21
21
const unlink = denodeify < string , void > ( fs . unlink as any ) ;
22
22
const stat = denodeify ( fs . stat ) ;
23
- const exec = denodeify < string , { cwd ?: string ; env ?: any ; maxBuffer ?: number ; } , { stdout : string ; stderr : string ; error : any } > ( cp . exec as any , ( error , stdout , stderr ) => [ undefined , { stdout, stderr, error } ] ) ;
24
23
const glob = denodeify < string , _glob . IOptions , string [ ] > ( _glob ) ;
25
24
26
25
const resourcesPath = path . join ( path . dirname ( __dirname ) , 'resources' ) ;
@@ -929,11 +928,12 @@ async function prepublish(cwd: string, manifest: Manifest, useYarn: boolean = fa
929
928
930
929
console . log ( `Executing prepublish script '${ useYarn ? 'yarn' : 'npm' } run vscode:prepublish'...` ) ;
931
930
932
- const { stdout, stderr, error } = await exec ( `${ useYarn ? 'yarn' : 'npm' } run vscode:prepublish` , { cwd, maxBuffer : 5000 * 1024 } ) ;
933
- process . stdout . write ( stdout ) ;
934
- // in case of error, stderr gets written by a top-level exception handler
935
- if ( error !== undefined ) throw error ;
936
- process . stderr . write ( stderr ) ;
931
+ await new Promise ( ( c , e ) => {
932
+ const tool = useYarn ? 'yarn' : 'npm' ;
933
+ const child = cp . spawn ( tool , [ 'run' , 'vscode:prepublish' ] , { cwd, shell : true , stdio : 'inherit' } ) ;
934
+ child . on ( 'exit' , code => code === 0 ? c ( ) : e ( `${ tool } failed with exit code ${ code } ` ) ) ;
935
+ child . on ( 'error' , e ) ;
936
+ } ) ;
937
937
}
938
938
939
939
async function getPackagePath ( cwd : string , manifest : Manifest , options : IPackageOptions = { } ) : Promise < string > {
0 commit comments