From 662f189fa64be1b0d3703b64a9fe37e4250ae5c4 Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Wed, 19 Sep 2018 17:17:05 +0300 Subject: [PATCH] fix: `tns platform add ios` should not be executed on non-macOS `tns platform add ios` should not be executed on non-macOS system. Currently in the master branch it exits silently, add correct error, so the user will know that it is not okay. --- lib/commands/add-platform.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/commands/add-platform.ts b/lib/commands/add-platform.ts index d10b24859e..20d42e5ef1 100644 --- a/lib/commands/add-platform.ts +++ b/lib/commands/add-platform.ts @@ -24,6 +24,11 @@ export class AddPlatformCommand extends ValidatePlatformCommandBase implements I let canExecute = true; for (const arg of args) { this.$platformService.validatePlatform(arg, this.$projectData); + + if (!this.$platformService.isPlatformSupportedForOS(arg, this.$projectData)) { + this.$errors.fail(`Applications for platform ${arg} can not be built on this OS`); + } + const output = await super.canExecuteCommandBase(arg); canExecute = canExecute && output.canExecute; }