Skip to content

Commit 665d93c

Browse files
Fix ios commands when platforms dir is removed
When you run `tns run ios`, nativescript-cli will add the ios platform in case you have not added it before that. But in case you have added the platform before that, but you have removed the platforms dir, the call fails. Make sure the platforms/ios directory exists before executing any action of copying the files.
1 parent d535be0 commit 665d93c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/services/ios-project-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ
9898

9999
public createProject(projectRoot: string, frameworkDir: string): IFuture<void> {
100100
return (() => {
101+
this.$fs.ensureDirectoryExists(path.join(projectRoot, IOSProjectService.IOS_PROJECT_NAME_PLACEHOLDER)).wait();
101102
if(this.$options.symlink) {
102-
this.$fs.ensureDirectoryExists(path.join(projectRoot, IOSProjectService.IOS_PROJECT_NAME_PLACEHOLDER)).wait();
103103
let xcodeProjectName = util.format("%s.xcodeproj", IOSProjectService.IOS_PROJECT_NAME_PLACEHOLDER);
104104

105105
shell.cp("-R", path.join(frameworkDir, IOSProjectService.IOS_PROJECT_NAME_PLACEHOLDER, "*"), path.join(projectRoot, IOSProjectService.IOS_PROJECT_NAME_PLACEHOLDER));

0 commit comments

Comments
 (0)