diff --git a/lib/commands/run.ts b/lib/commands/run.ts index 5e34cfe578..2e87e58376 100644 --- a/lib/commands/run.ts +++ b/lib/commands/run.ts @@ -66,7 +66,7 @@ export class RunIosCommand implements ICommand { private $errors: IErrors, private $injector: IInjector, private $platformService: IPlatformService, - private $projectData: IProjectData, + private $projectDataService: IProjectDataService, private $options: IOptions) { } @@ -75,11 +75,13 @@ export class RunIosCommand implements ICommand { } public async canExecute(args: string[]): Promise { - if (!this.$platformService.isPlatformSupportedForOS(this.$devicePlatformsConstants.iOS, this.$projectData)) { + const projectData = this.$projectDataService.getProjectData(); + + if (!this.$platformService.isPlatformSupportedForOS(this.$devicePlatformsConstants.iOS, projectData)) { this.$errors.fail(`Applications for platform ${this.$devicePlatformsConstants.iOS} can not be built on this OS`); } - const result = await this.runCommand.canExecute(args) && await this.$platformService.validateOptions(this.$options.provision, this.$options.teamId, this.$projectData, this.$platformsData.availablePlatforms.iOS); + const result = await this.runCommand.canExecute(args) && await this.$platformService.validateOptions(this.$options.provision, this.$options.teamId, projectData, this.$platformsData.availablePlatforms.iOS); return result; } }