File tree 2 files changed +19
-2
lines changed
2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -148,7 +148,16 @@ gulp.task('installFixtures', function() {
148
148
} , 1 * 1000 ) ;
149
149
shell . cd ( 'test/fixtures' ) ;
150
150
151
- execAsync ( 'npm install --quiet' , { cwd : '../fixtures' } ) . then ( ( ) => {
151
+ let installCommand ;
152
+ if ( process . platform === 'win32' ) {
153
+ installCommand = 'yarn --version >nul 2>&1 && ( yarn install ) || ( npm install --quiet )' ;
154
+ } else {
155
+ installCommand = 'type yarn &> /dev/null | yarn install || npm install --quiet' ;
156
+ }
157
+
158
+ execAsync ( installCommand , {
159
+ cwd : '../fixtures'
160
+ } ) . then ( ( ) => {
152
161
process . stdout . write ( '\n' ) ;
153
162
if ( ! process . env . SAUCE_USERNAME ) {
154
163
gutil . log ( 'running npm run-script update-webdriver' ) ;
Original file line number Diff line number Diff line change @@ -606,7 +606,15 @@ export class Generator extends Base {
606
606
607
607
install ( ) {
608
608
if ( ! this . options [ 'skip-install' ] ) {
609
- this . spawnCommand ( 'npm' , [ 'install' ] ) ;
609
+ let yarnCheckCommand ;
610
+ if ( process . platform === 'win32' ) {
611
+ yarnCheckCommand = 'yarn --version >nul 2>&1' ;
612
+ } else {
613
+ yarnCheckCommand = 'type yarn &> /dev/null' ;
614
+ }
615
+ exec ( yarnCheckCommand , ( error , stdout , stderr ) => {
616
+ return this . spawnCommand ( ( ! error ) ? 'yarn' : 'npm' , [ 'install' ] ) ;
617
+ } ) ;
610
618
}
611
619
}
612
620
You can’t perform that action at this time.
0 commit comments