From 665d93c9c5b4501bc25184d1266ccaba4eed534e Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Wed, 2 Sep 2015 12:14:08 +0300 Subject: [PATCH] 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. --- lib/services/ios-project-service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/services/ios-project-service.ts b/lib/services/ios-project-service.ts index 92b8dcb9c0..2d7286fb19 100644 --- a/lib/services/ios-project-service.ts +++ b/lib/services/ios-project-service.ts @@ -98,8 +98,8 @@ export class IOSProjectService extends projectServiceBaseLib.PlatformProjectServ public createProject(projectRoot: string, frameworkDir: string): IFuture { return (() => { + this.$fs.ensureDirectoryExists(path.join(projectRoot, IOSProjectService.IOS_PROJECT_NAME_PLACEHOLDER)).wait(); if(this.$options.symlink) { - this.$fs.ensureDirectoryExists(path.join(projectRoot, IOSProjectService.IOS_PROJECT_NAME_PLACEHOLDER)).wait(); let xcodeProjectName = util.format("%s.xcodeproj", IOSProjectService.IOS_PROJECT_NAME_PLACEHOLDER); shell.cp("-R", path.join(frameworkDir, IOSProjectService.IOS_PROJECT_NAME_PLACEHOLDER, "*"), path.join(projectRoot, IOSProjectService.IOS_PROJECT_NAME_PLACEHOLDER));