Skip to content

Commit 75c2121

Browse files
Fix baseConfig option for iOS
When `--baseConfig` option is used for `tns platform add ios`, the command fails with ENOTEMPTY. The reason is that we copy the baseConfig file before creating correct directories and when we try to rename __PROJECT_NAME__ dir to real project name, it fails as we have already created this dir.
1 parent f7971c1 commit 75c2121

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

lib/services/platform-service.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,6 @@ export class PlatformService implements IPlatformService {
113113

114114
let sourceFrameworkDir = isFrameworkPathDirectory && this.$options.symlink ? path.join(this.$options.frameworkPath, "framework") : frameworkDir;
115115
platformData.platformProjectService.createProject(path.resolve(sourceFrameworkDir), installedVersion).wait();
116-
if(this.$options.baseConfig) {
117-
let newConfigFile = path.resolve(this.$options.baseConfig);
118-
this.$logger.trace(`Replacing '${platformData.configurationFilePath}' with '${newConfigFile}'.`);
119-
this.$fs.copyFile(newConfigFile, platformData.configurationFilePath).wait();
120-
}
121116

122117
if(isFrameworkPathDirectory || isFrameworkPathNotSymlinkedFile) {
123118
// Need to remove unneeded node_modules folder
@@ -128,6 +123,12 @@ export class PlatformService implements IPlatformService {
128123
platformData.platformProjectService.interpolateData().wait();
129124
platformData.platformProjectService.afterCreateProject(platformData.projectRoot).wait();
130125

126+
if(this.$options.baseConfig) {
127+
let newConfigFile = path.resolve(this.$options.baseConfig);
128+
this.$logger.trace(`Replacing '${platformData.configurationFilePath}' with '${newConfigFile}'.`);
129+
this.$fs.copyFile(newConfigFile, platformData.configurationFilePath).wait();
130+
}
131+
131132
this.$projectDataService.initialize(this.$projectData.projectDir);
132133
this.$projectDataService.setValue(platformData.frameworkPackageName, {version: installedVersion}).wait();
133134

0 commit comments

Comments
 (0)