5
5
6
6
const cp = require ( 'child_process' ) ;
7
7
const path = require ( 'path' ) ;
8
- const npm = process . platform === 'win32' ? 'npm .cmd' : 'npm ' ;
8
+ const yarn = process . platform === 'win32' ? 'yarn .cmd' : 'yarn ' ;
9
9
10
- function npmInstall ( location , opts ) {
10
+ process . exit ( 0 ) ;
11
+
12
+ function yarnInstall ( location , opts ) {
11
13
opts = opts || { } ;
12
14
opts . cwd = location ;
13
15
opts . stdio = 'inherit' ;
14
16
15
- const result = cp . spawnSync ( npm , [ 'install' ] , opts ) ;
17
+ const result = cp . spawnSync ( yarn , [ 'install' ] , opts ) ;
16
18
17
19
if ( result . error || result . status !== 0 ) {
18
20
process . exit ( 1 ) ;
19
21
}
20
22
}
21
23
22
- npmInstall ( 'extensions' ) ; // node modules shared by all extensions
24
+ yarnInstall ( 'extensions' ) ; // node modules shared by all extensions
23
25
24
26
const extensions = [
25
27
'vscode-api-tests' ,
@@ -43,9 +45,9 @@ const extensions = [
43
45
'jake'
44
46
] ;
45
47
46
- extensions . forEach ( extension => npmInstall ( `extensions/${ extension } ` ) ) ;
48
+ extensions . forEach ( extension => yarnInstall ( `extensions/${ extension } ` ) ) ;
47
49
48
- function npmInstallBuildDependencies ( ) {
50
+ function yarnInstallBuildDependencies ( ) {
49
51
// make sure we install gulp watch for the system installed
50
52
// node, since that is the driver of gulp
51
53
const env = Object . assign ( { } , process . env ) ;
@@ -54,9 +56,9 @@ function npmInstallBuildDependencies() {
54
56
delete env [ 'npm_config_target' ] ;
55
57
delete env [ 'npm_config_runtime' ] ;
56
58
57
- npmInstall ( path . join ( path . dirname ( __dirname ) , 'lib' , 'watch' ) , { env } ) ;
59
+ yarnInstall ( path . join ( path . dirname ( __dirname ) , 'lib' , 'watch' ) , { env } ) ;
58
60
}
59
61
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