From 0c07e2ea7936da8ee723590825f3ba20696f3a54 Mon Sep 17 00:00:00 2001 From: Nadya Atanasova Date: Tue, 20 Jun 2017 14:32:18 +0300 Subject: [PATCH 1/2] Pass correct release arguments to run command https://github.com/NativeScript/nativescript-cli/issues/2903 --- lib/commands/run.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/commands/run.ts b/lib/commands/run.ts index d9ddb79c1a..255d7572bb 100644 --- a/lib/commands/run.ts +++ b/lib/commands/run.ts @@ -97,10 +97,18 @@ export class RunCommandBase implements ICommand { const runPlatformOptions: IRunPlatformOptions = { device: this.$options.device, emulator: this.$options.emulator, - justlaunch: this.$options.justlaunch, + justlaunch: this.$options.justlaunch }; - const deployOptions = _.merge({ projectDir: this.$projectData.projectDir, clean: true }, this.$options); + const deployOptions = _.merge({ + projectDir: this.$projectData.projectDir, + clean: true, + release: this.$options.release, + keyStoreAlias: this.$options.keyStoreAlias, + keyStoreAliasPassword: this.$options.keyStoreAliasPassword, + keyStorePassword: this.$options.keyStorePassword, + keyStorePath: this.$options.keyStorePath + }, this.$options); await this.$platformService.deployPlatform(args[0], this.$options, deployOptions, this.$projectData, this.$options); await this.$platformService.startApplication(args[0], runPlatformOptions, this.$projectData.projectId); From 29bb5b2642e483030e615629967363563d9a0c3d Mon Sep 17 00:00:00 2001 From: rosen-vladimirov Date: Tue, 20 Jun 2017 15:42:55 +0300 Subject: [PATCH 2/2] Fix merge of options during `tns run` The `$options` object has the required information for all passed `--` args, but all of them are in `get` methods. Calling `merge` does not get functions (like `get`ers), so we do not receive expected options (like `--release, --keyStorePath`, etc.) in the merged object. In order to fix this just use the `this.$options.argv` which contains the information we need. --- lib/commands/run.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/commands/run.ts b/lib/commands/run.ts index 255d7572bb..17ece86524 100644 --- a/lib/commands/run.ts +++ b/lib/commands/run.ts @@ -103,12 +103,7 @@ export class RunCommandBase implements ICommand { const deployOptions = _.merge({ projectDir: this.$projectData.projectDir, clean: true, - release: this.$options.release, - keyStoreAlias: this.$options.keyStoreAlias, - keyStoreAliasPassword: this.$options.keyStoreAliasPassword, - keyStorePassword: this.$options.keyStorePassword, - keyStorePath: this.$options.keyStorePath - }, this.$options); + }, this.$options.argv); await this.$platformService.deployPlatform(args[0], this.$options, deployOptions, this.$projectData, this.$options); await this.$platformService.startApplication(args[0], runPlatformOptions, this.$projectData.projectId);