Skip to content

Commit 334682a

Browse files
Merge pull request #1277 from NativeScript/vladimirov/fix-prepare
Fix prepare command
2 parents afbbc92 + 70e89f6 commit 334682a

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/commands/prepare.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22
"use strict";
33

44
export class PrepareCommand implements ICommand {
5-
constructor(private $platformService: IPlatformService,
5+
constructor(private $errors: IErrors,
6+
private $platformService: IPlatformService,
67
private $platformCommandParameter: ICommandParameter) { }
78

89
execute(args: string[]): IFuture<void> {
910
return (() => {
10-
this.$platformService.preparePlatform(args[0]);
11+
if (!this.$platformService.preparePlatform(args[0]).wait()) {
12+
this.$errors.failWithoutHelp("Unable to prepare the project.");
13+
}
1114
}).future<void>()();
1215
}
1316

lib/services/platform-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ export class PlatformService implements IPlatformService {
187187
parser.parseFromString(fileContents, "text/xml");
188188
xmlHasErrors = xmlHasErrors || hasErrors;
189189
if (xmlHasErrors) {
190-
this.$logger.out("Error: ".red.bold + `${file} has syntax errors.`);
190+
this.$logger.out("Error: ".red.bold + file + " has syntax errors.".red.bold);
191191
}
192192
});
193193
return !xmlHasErrors;

0 commit comments

Comments
 (0)