Skip to content

Commit a30bedb

Browse files
Merge pull request #4663 from NativeScript/fatme/fix-crash-on-deploy
fix: fix the application crash on device on deploy command
2 parents b5dcf44 + 1937b7a commit a30bedb

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

lib/commands/build.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export abstract class BuildCommandBase extends ValidatePlatformCommandBase {
1818

1919
public dashedOptions = {
2020
watch: { type: OptionType.Boolean, default: false, hasSensitiveValue: false },
21+
hmr: { type: OptionType.Boolean, default: false, hasSensitiveValue: false },
2122
};
2223

2324
public async executeCore(args: string[]): Promise<string> {

lib/commands/deploy.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ import { DeployCommandHelper } from "../helpers/deploy-command-helper";
55
export class DeployOnDeviceCommand extends ValidatePlatformCommandBase implements ICommand {
66
public allowedParameters: ICommandParameter[] = [];
77

8+
public dashedOptions = {
9+
hmr: { type: OptionType.Boolean, default: false, hasSensitiveValue: false },
10+
};
11+
812
constructor($platformValidationService: IPlatformValidationService,
913
private $platformCommandParameter: ICommandParameter,
1014
$options: IOptions,

lib/commands/prepare.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export class PrepareCommand extends ValidatePlatformCommandBase implements IComm
77

88
public dashedOptions = {
99
watch: { type: OptionType.Boolean, default: false, hasSensitiveValue: false },
10+
hmr: { type: OptionType.Boolean, default: false, hasSensitiveValue: false },
1011
};
1112

1213
constructor($options: IOptions,

lib/controllers/deploy-controller.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ export class DeployController {
1111
const { liveSyncInfo, deviceDescriptors } = data;
1212

1313
const executeAction = async (device: Mobile.IDevice) => {
14-
const buildData = this.$buildDataService.getBuildData(liveSyncInfo.projectDir, device.deviceInfo.platform, liveSyncInfo);
14+
const options = { ...liveSyncInfo, buildForDevice: !device.isEmulator };
15+
const buildData = this.$buildDataService.getBuildData(liveSyncInfo.projectDir, device.deviceInfo.platform, options);
1516
await this.$buildController.prepareAndBuild(buildData);
1617
await this.$deviceInstallAppService.installOnDevice(device, buildData);
1718
};

0 commit comments

Comments
 (0)