Skip to content

Commit 994fddc

Browse files
author
Fatme
authored
Merge pull request NativeScript#4538 from jamesgeorge007/hotfix/show-right-message-cli
Shows an appropriate message while trying to run the app in a non-project folder
2 parents 3267539 + 1f5f160 commit 994fddc

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/commands/run.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export class RunIosCommand implements ICommand {
6666
private $errors: IErrors,
6767
private $injector: IInjector,
6868
private $platformService: IPlatformService,
69-
private $projectData: IProjectData,
69+
private $projectDataService: IProjectDataService,
7070
private $options: IOptions) {
7171
}
7272

@@ -75,11 +75,13 @@ export class RunIosCommand implements ICommand {
7575
}
7676

7777
public async canExecute(args: string[]): Promise<boolean> {
78-
if (!this.$platformService.isPlatformSupportedForOS(this.$devicePlatformsConstants.iOS, this.$projectData)) {
78+
const projectData = this.$projectDataService.getProjectData();
79+
80+
if (!this.$platformService.isPlatformSupportedForOS(this.$devicePlatformsConstants.iOS, projectData)) {
7981
this.$errors.fail(`Applications for platform ${this.$devicePlatformsConstants.iOS} can not be built on this OS`);
8082
}
8183

82-
const result = await this.runCommand.canExecute(args) && await this.$platformService.validateOptions(this.$options.provision, this.$options.teamId, this.$projectData, this.$platformsData.availablePlatforms.iOS);
84+
const result = await this.runCommand.canExecute(args) && await this.$platformService.validateOptions(this.$options.provision, this.$options.teamId, projectData, this.$platformsData.availablePlatforms.iOS);
8385
return result;
8486
}
8587
}

0 commit comments

Comments
 (0)