@@ -81,7 +81,7 @@ function installPristineApp(appName, options) {
8181 chdir ( temp . pristinePath ) ;
8282
8383 // Install a vanilla app and cd into it
84- let args = generateArgsForEmberNew ( hasNodeModules , hasBowerComponents ) ;
84+ let args = generateArgsForEmberNew ( hasNodeModules , hasBowerComponents , options ) ;
8585 let promise = runNew ( appName , args )
8686 . catch ( handleResult )
8787 . then ( ( ) => chdir ( path . join ( temp . pristinePath , appName ) ) ) ;
@@ -91,7 +91,8 @@ function installPristineApp(appName, options) {
9191 hasNodeModules,
9292 hasBowerComponents,
9393 emberVersion : options . emberVersion || 'canary' ,
94- emberDataVersion : options . emberDataVersion || 'emberjs/data#master'
94+ emberDataVersion : options . emberDataVersion || 'emberjs/data#master' ,
95+ yarn : options . yarn || false
9596 } ;
9697
9798 promise = promise
@@ -111,9 +112,14 @@ function installPristineApp(appName, options) {
111112
112113// Generates the arguments to pass to `ember new`. Optionally skipping the
113114// npm and/or bower installation phases.
114- function generateArgsForEmberNew ( skipNpm , skipBower ) {
115+ function generateArgsForEmberNew ( skipNpm , skipBower , options ) {
115116 let extraOptions = [ ] ;
116117
118+ if ( options . yarn ) {
119+ debug ( 'using yarn' ) ;
120+ extraOptions . push ( '--yarn' ) ;
121+ }
122+
117123 if ( skipNpm ) {
118124 debug ( 'skipping npm' ) ;
119125 extraOptions . push ( '--skip-npm' ) ;
@@ -142,11 +148,19 @@ function nodeModulesSetup(options) {
142148 promise = promise
143149 . then ( ( ) => {
144150 debug ( 'installing ember-disable-prototype-extensions' ) ;
145- return runCommand ( 'npm' , 'install' , 'ember-disable-prototype-extensions' ) ;
151+ if ( options . yarn ) {
152+ return runCommand ( 'yarn' , 'add' , 'ember-disable-prototype-extensions' ) ;
153+ } else {
154+ return runCommand ( 'npm' , 'install' , 'ember-disable-prototype-extensions' ) ;
155+ }
146156 } )
147157 . then ( ( ) => {
148158 debug ( "installed ember-disable-prototype-extension" ) ;
149- return runCommand ( 'npm' , 'install' ) ;
159+ if ( options . yarn ) {
160+ return runCommand ( 'yarn' ) ;
161+ } else {
162+ return runCommand ( 'npm' , 'install' ) ;
163+ }
150164 } )
151165 . then ( ( ) => debug ( 'installed ember-data ' + emberDataVersion ) )
152166 . then ( ( ) => symlinkAddon ( appName ) )
0 commit comments