@@ -11,6 +11,7 @@ export interface ILocalDependencyData extends IDependencyData {
11
11
export class TnsModulesCopy {
12
12
constructor (
13
13
private outputRoot : string ,
14
+ private $options : IOptions ,
14
15
private $fs : IFileSystem
15
16
) {
16
17
}
@@ -25,13 +26,15 @@ export class TnsModulesCopy {
25
26
let tnsCoreModulesResourcePath = path . join ( this . outputRoot , constants . TNS_CORE_MODULES_NAME ) ;
26
27
27
28
// Remove .ts files
28
- let allFiles = this . $fs . enumerateFilesInDirectorySync ( tnsCoreModulesResourcePath ) ;
29
- let deleteFilesFutures = allFiles . filter ( file => minimatch ( file , "**/*.ts" , { nocase : true } ) ) . map ( file => this . $fs . deleteFile ( file ) ) ;
30
- Future . wait ( deleteFilesFutures ) ;
29
+ if ( this . $options . release ) {
30
+ let allFiles = this . $fs . enumerateFilesInDirectorySync ( tnsCoreModulesResourcePath ) ;
31
+ let deleteFilesFutures = allFiles . filter ( file => minimatch ( file , "**/*.ts" , { nocase : true } ) ) . map ( file => this . $fs . deleteFile ( file ) ) ;
32
+ Future . wait ( deleteFilesFutures ) ;
33
+ }
31
34
32
35
shelljs . rm ( "-rf" , path . join ( tnsCoreModulesResourcePath , "node_modules" ) ) ;
33
36
34
- // TODO: The following two lines are necessary to temporarily work around hardcoded
37
+ // TODO: The following two lines are necessary to temporarily work around hardcoded
35
38
// path dependencies in iOS livesync logic. Should be addressed ASAP
36
39
shelljs . cp ( "-Rf" , path . join ( tnsCoreModulesResourcePath , "*" ) , this . outputRoot ) ;
37
40
shelljs . rm ( "-rf" , tnsCoreModulesResourcePath ) ;
0 commit comments