44@module ember-cli
55*/
66var FileInfo = require ( './file-info' ) ;
7- var Promise = require ( '../ext/promise' ) ;
7+ var RSVP = require ( 'rsvp' ) ;
8+ var Promise = RSVP . Promise ;
89var chalk = require ( 'chalk' ) ;
910var printableProperties = require ( '../utilities/printable-properties' ) . blueprint ;
1011var sequence = require ( '../utilities/sequence' ) ;
@@ -13,7 +14,7 @@ var fs = require('fs-extra');
1314var inflector = require ( 'inflection' ) ;
1415var minimatch = require ( 'minimatch' ) ;
1516var path = require ( 'path' ) ;
16- var stat = Promise . denodeify ( fs . stat ) ;
17+ var stat = RSVP . denodeify ( fs . stat ) ;
1718var stringUtils = require ( 'ember-cli-string-utils' ) ;
1819var compact = require ( 'lodash/compact' ) ;
1920var intersect = require ( 'lodash/intersection' ) ;
@@ -26,8 +27,8 @@ var keys = require('lodash/keys');
2627var merge = require ( 'lodash/merge' ) ;
2728var values = require ( 'lodash/values' ) ;
2829var walkSync = require ( 'walk-sync' ) ;
29- var writeFile = Promise . denodeify ( fs . outputFile ) ;
30- var removeFile = Promise . denodeify ( fs . remove ) ;
30+ var writeFile = RSVP . denodeify ( fs . outputFile ) ;
31+ var removeFile = RSVP . denodeify ( fs . remove ) ;
3132var SilentError = require ( 'silent-error' ) ;
3233var CoreObject = require ( 'core-object' ) ;
3334var EOL = require ( 'os' ) . EOL ;
@@ -493,7 +494,8 @@ Blueprint.prototype._process = function(options, beforeHook, process, afterHook)
493494 return this . _locals ( options ) . then ( function ( locals ) {
494495 return Promise . resolve ( )
495496 . then ( beforeHook . bind ( self , options , locals ) )
496- . then ( process . bind ( self , intoDir , locals ) ) . map ( self . _commit . bind ( self ) )
497+ . then ( process . bind ( self , intoDir , locals ) )
498+ . then ( promises => RSVP . map ( promises , self . _commit . bind ( self ) ) )
497499 . then ( afterHook . bind ( self , options ) ) ;
498500 } ) ;
499501} ;
@@ -774,9 +776,9 @@ Blueprint.prototype.processFiles = function(intoDir, templateVariables) {
774776
775777 this . _ignoreUpdateFiles ( ) ;
776778
777- return Promise . filter ( fileInfos , isValidFile ) .
778- map ( prepareConfirm ) .
779- then ( finishProcessingForInstall ) ;
779+ return RSVP . filter ( fileInfos , isValidFile )
780+ . then ( promises => RSVP . map ( promises , prepareConfirm ) )
781+ . then ( finishProcessingForInstall ) ;
780782} ;
781783
782784/**
@@ -789,7 +791,7 @@ Blueprint.prototype.processFilesForUninstall = function(intoDir, templateVariabl
789791
790792 this . _ignoreUpdateFiles ( ) ;
791793
792- return Promise . filter ( fileInfos , isValidFile ) .
794+ return RSVP . filter ( fileInfos , isValidFile ) .
793795 then ( finishProcessingForUninstall ) ;
794796} ;
795797
@@ -1374,7 +1376,7 @@ function gatherConfirmationMessages(collection, info) {
13741376 @return {Boolean }
13751377*/
13761378function isFile ( info ) {
1377- return stat ( info . inputPath ) . invoke ( ' isFile' ) ;
1379+ return stat ( info . inputPath ) . then ( it => it . isFile ( ) ) ;
13781380}
13791381
13801382/**
0 commit comments