55
66const cp = require ( 'child_process' ) ;
77const path = require ( 'path' ) ;
8- const npm = process . platform === 'win32' ? 'npm .cmd' : 'npm ' ;
8+ const yarn = process . platform === 'win32' ? 'yarn .cmd' : 'yarn ' ;
99
10- function npmInstall ( location , opts ) {
10+ process . exit ( 0 ) ;
11+
12+ function yarnInstall ( location , opts ) {
1113 opts = opts || { } ;
1214 opts . cwd = location ;
1315 opts . stdio = 'inherit' ;
1416
15- const result = cp . spawnSync ( npm , [ 'install' ] , opts ) ;
17+ const result = cp . spawnSync ( yarn , [ 'install' ] , opts ) ;
1618
1719 if ( result . error || result . status !== 0 ) {
1820 process . exit ( 1 ) ;
1921 }
2022}
2123
22- npmInstall ( 'extensions' ) ; // node modules shared by all extensions
24+ yarnInstall ( 'extensions' ) ; // node modules shared by all extensions
2325
2426const extensions = [
2527 'vscode-api-tests' ,
@@ -43,9 +45,9 @@ const extensions = [
4345 'jake'
4446] ;
4547
46- extensions . forEach ( extension => npmInstall ( `extensions/${ extension } ` ) ) ;
48+ extensions . forEach ( extension => yarnInstall ( `extensions/${ extension } ` ) ) ;
4749
48- function npmInstallBuildDependencies ( ) {
50+ function yarnInstallBuildDependencies ( ) {
4951 // make sure we install gulp watch for the system installed
5052 // node, since that is the driver of gulp
5153 const env = Object . assign ( { } , process . env ) ;
@@ -54,9 +56,9 @@ function npmInstallBuildDependencies() {
5456 delete env [ 'npm_config_target' ] ;
5557 delete env [ 'npm_config_runtime' ] ;
5658
57- npmInstall ( path . join ( path . dirname ( __dirname ) , 'lib' , 'watch' ) , { env } ) ;
59+ yarnInstall ( path . join ( path . dirname ( __dirname ) , 'lib' , 'watch' ) , { env } ) ;
5860}
5961
60- npmInstall ( `build` ) ; // node modules required for build
61- npmInstall ( 'test/smoke' ) ; // node modules required for smoketest
62- npmInstallBuildDependencies ( ) ; // node modules for watching, specific to host node version, not electron
62+ yarnInstall ( `build` ) ; // node modules required for build
63+ yarnInstall ( 'test/smoke' ) ; // node modules required for smoketest
64+ yarnInstallBuildDependencies ( ) ; // node modules for watching, specific to host node version, not electron
0 commit comments