@@ -61,7 +61,7 @@ class IOSProjectService implements IPlatformProjectService {
6161
6262 public createProject ( projectRoot : string , frameworkDir : string ) : IFuture < void > {
6363 return ( ( ) => {
64- shell . cp ( "-r " , path . join ( frameworkDir , "*" ) , projectRoot ) ;
64+ shell . cp ( "-R " , path . join ( frameworkDir , "*" ) , projectRoot ) ;
6565 } ) . future < void > ( ) ( ) ;
6666 }
6767
@@ -89,11 +89,11 @@ class IOSProjectService implements IPlatformProjectService {
8989 var appDestinationDirectory = path . join ( platformData . projectRoot , this . $projectData . projectName ) ;
9090 var resDirectory = path . join ( platformData . projectRoot , this . $projectData . projectName , "Resources" , "icons" ) ;
9191
92- shell . cp ( "-r " , path . join ( appSourceDirectory , "*" ) , appDestinationDirectory ) ;
92+ shell . cp ( "-Rf " , path . join ( appSourceDirectory , "*" ) , appDestinationDirectory ) ;
9393
9494 var appResourcesDirectoryPath = path . join ( appDestinationDirectory , constants . APP_RESOURCES_FOLDER_NAME ) ;
9595 if ( this . $fs . exists ( appResourcesDirectoryPath ) . wait ( ) ) {
96- shell . cp ( "-r " , path . join ( appResourcesDirectoryPath , platformData . normalizedPlatformName , "*" ) , resDirectory ) ;
96+ shell . cp ( "-Rf " , path . join ( appResourcesDirectoryPath , platformData . normalizedPlatformName , "*" ) , resDirectory ) ;
9797 this . $fs . deleteDirectory ( appResourcesDirectoryPath ) . wait ( ) ;
9898 }
9999
@@ -128,7 +128,7 @@ class IOSProjectService implements IPlatformProjectService {
128128 ] ) ;
129129 }
130130
131- this . spawn ( "xcodebuild" , args , "exit" , { cwd : options , stdio : 'inherit' } ) . wait ( ) ;
131+ this . $childProcess . spawnFromEvent ( "xcodebuild" , args , "exit" , { cwd : options , stdio : 'inherit' } ) . wait ( ) ;
132132
133133 if ( options . device ) {
134134 var buildOutputPath = path . join ( projectRoot , "build" , options . device ? "device" : "emulator" ) ;
@@ -141,29 +141,11 @@ class IOSProjectService implements IPlatformProjectService {
141141 "-o" , path . join ( buildOutputPath , this . $projectData . projectName + ".ipa" )
142142 ] ;
143143
144- this . spawn ( "xcrun" , xcrunArgs , "exit" , { cwd : options , stdio : 'inherit' } ) . wait ( ) ;
144+ this . $childProcess . spawnFromEvent ( "xcrun" , xcrunArgs , "exit" , { cwd : options , stdio : 'inherit' } ) . wait ( ) ;
145145 }
146146 } ) . future < void > ( ) ( ) ;
147147 }
148148
149- private spawn ( command : string , args : string [ ] , event : string , options ?: any ) : IFuture < void > { // event should be exit or close
150- var future = new Future < void > ( ) ;
151- var childProcess = this . $childProcess . spawn ( command , args , options ) ;
152- childProcess . once ( event , ( ) => {
153- var args = _ . toArray ( arguments ) ;
154- var statusCode = args [ 0 ] ;
155- var signal = args [ 1 ] ;
156-
157- if ( statusCode !== 0 ) {
158- future . throw ( util . format ( "Command %s exited with code %s" , command , statusCode ) ) ;
159- } else {
160- future . return ( ) ;
161- }
162- } ) ;
163-
164- return future ;
165- }
166-
167149 private replaceFileContent ( file : string ) : IFuture < void > {
168150 return ( ( ) => {
169151 var fileContent = this . $fs . readText ( file ) . wait ( ) ;
0 commit comments