Skip to content

Commit ed7dd14

Browse files
Fatme HavaluovaFatme Havaluova
Fatme Havaluova
authored and
Fatme Havaluova
committed
Don't print incorrect message when tns deploy ios --release command is executed
FIxes #1403
1 parent 8d93603 commit ed7dd14

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

lib/commands/deploy.ts

+13-4
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ export class DeployOnDeviceCommand implements ICommand {
55
constructor(private $platformService: IPlatformService,
66
private $platformCommandParameter: ICommandParameter,
77
private $options: IOptions,
8-
private $errors: IErrors) { }
8+
private $errors: IErrors,
9+
private $mobileHelper: Mobile.IMobileHelper) { }
910

1011
execute(args: string[]): IFuture<void> {
1112
let config = this.$options.staticBindings ? { runSbGenerator: true } : undefined;
@@ -14,11 +15,19 @@ export class DeployOnDeviceCommand implements ICommand {
1415

1516
public canExecute(args: string[]): IFuture<boolean> {
1617
return (() => {
17-
if (this.$options.release && (!this.$options.keyStorePath || !this.$options.keyStorePassword || !this.$options.keyStoreAlias || !this.$options.keyStoreAliasPassword)) {
18+
if (!args || !args.length || args.length > 1) {
19+
return false;
20+
}
21+
22+
if (!this.$platformCommandParameter.validate(args[0]).wait()) {
23+
return false;
24+
}
25+
26+
if (this.$mobileHelper.isAndroidPlatform(args[0]) && this.$options.release && (!this.$options.keyStorePath || !this.$options.keyStorePassword || !this.$options.keyStoreAlias || !this.$options.keyStoreAliasPassword)) {
1827
this.$errors.fail("When producing a release build, you need to specify all --key-store-* options.");
1928
}
20-
let res = (args.length === 1) && this.$platformCommandParameter.validate(args[0]).wait();
21-
return res;
29+
30+
return true;
2231
}).future<boolean>()();
2332
}
2433

0 commit comments

Comments
 (0)