File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Expand file tree Collapse file tree 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() {
148148 } , 1 * 1000 ) ;
149149 shell . cd ( 'test/fixtures' ) ;
150150
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 ( ( ) => {
152161 process . stdout . write ( '\n' ) ;
153162 if ( ! process . env . SAUCE_USERNAME ) {
154163 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 {
606606
607607 install ( ) {
608608 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+ } ) ;
610618 }
611619 }
612620
You can’t perform that action at this time.
0 commit comments