From 70e89f6025a92a52ea0fbc19d87bdfb59035b9ce Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Mon, 30 Nov 2015 09:40:03 +0200 Subject: [PATCH] Fix prepare command Add missing wait in prepare command. Make sure the whole message for invalid xml is red. --- lib/commands/prepare.ts | 7 +++++-- lib/services/platform-service.ts | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/commands/prepare.ts b/lib/commands/prepare.ts index 2185388f0b..4fbf79ad92 100644 --- a/lib/commands/prepare.ts +++ b/lib/commands/prepare.ts @@ -2,12 +2,15 @@ "use strict"; export class PrepareCommand implements ICommand { - constructor(private $platformService: IPlatformService, + constructor(private $errors: IErrors, + private $platformService: IPlatformService, private $platformCommandParameter: ICommandParameter) { } execute(args: string[]): IFuture { return (() => { - this.$platformService.preparePlatform(args[0]); + if (!this.$platformService.preparePlatform(args[0]).wait()) { + this.$errors.failWithoutHelp("Unable to prepare the project."); + } }).future()(); } diff --git a/lib/services/platform-service.ts b/lib/services/platform-service.ts index 2f568743d7..5cc1698b69 100644 --- a/lib/services/platform-service.ts +++ b/lib/services/platform-service.ts @@ -187,7 +187,7 @@ export class PlatformService implements IPlatformService { parser.parseFromString(fileContents, "text/xml"); xmlHasErrors = xmlHasErrors || hasErrors; if (xmlHasErrors) { - this.$logger.out("Error: ".red.bold + `${file} has syntax errors.`); + this.$logger.out("Error: ".red.bold + file + " has syntax errors.".red.bold); } }); return !xmlHasErrors;