@@ -35,21 +35,21 @@ export class TnsModulesCopy {
35
35
}
36
36
37
37
private copyDependencyDir ( dependency : IDependencyData ) : void {
38
- if ( dependency . depth === 0 ) {
39
- let isScoped = dependency . name . indexOf ( "@" ) === 0 ;
40
- let targetDir = this . outputRoot ;
38
+ const targetPackageDir = path . join ( this . outputRoot , dependency . name ) ;
41
39
42
- if ( isScoped ) {
43
- targetDir = path . join ( this . outputRoot , dependency . name . substring ( 0 , dependency . name . indexOf ( "/" ) ) ) ;
44
- }
40
+ // check if dependency is scoped, and create a parent @scope directory to copy dependencies into
41
+ // shelljs otherwise complains during the copy step: 'cp: cannot create directory'
42
+ // let isScoped = dependency.name.indexOf("@") === 0;
45
43
46
- shelljs . mkdir ( "-p" , targetDir ) ;
47
- shelljs . cp ( "-Rf" , dependency . directory , targetDir ) ;
44
+ // if (isScoped) {
45
+ // shelljs.mkdir("-p", path.join(this.outputRoot, dependency.name.substring(0, dependency.name.indexOf("/"))));
46
+ // }
48
47
49
- // remove platform-specific files (processed separately by plugin services)
50
- const targetPackageDir = path . join ( isScoped ? this . outputRoot : targetDir , dependency . name ) ;
51
- shelljs . rm ( "-rf" , path . join ( targetPackageDir , "platforms" ) ) ;
52
- }
48
+ shelljs . mkdir ( "-p" , targetPackageDir ) ;
49
+ shelljs . cp ( "-Rf" , dependency . directory , this . outputRoot ) ;
50
+
51
+ // remove platform-specific files (processed separately by plugin services)
52
+ shelljs . rm ( "-rf" , path . join ( targetPackageDir , "platforms" ) ) ;
53
53
}
54
54
}
55
55
0 commit comments