Skip to content

Commit 6aeac22

Browse files
committed
fix: don't show the help on run command when the version of nativescript-dev-webpack is lower than 1.0.0
1 parent da1870e commit 6aeac22

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/common/mobile/mobile-core/devices-service.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,7 @@ export class DevicesService extends EventEmitter implements Mobile.IDevicesServi
444444
}
445445
} catch (err) {
446446
err.deviceIdentifier = device.deviceInfo.identifier;
447+
this.$logger.trace(`Error while executing action on device ${device.deviceInfo.identifier}. The error is ${err}`);
447448
errors.push(err);
448449
}
449450
}
@@ -454,9 +455,9 @@ export class DevicesService extends EventEmitter implements Mobile.IDevicesServi
454455
preErrorMsg = "Multiple errors were thrown:" + EOL;
455456
}
456457

457-
const singleError = <Mobile.IDevicesOperationError>(new Error(`${preErrorMsg}${errors.map(e => e.message || e).join(EOL)}`));
458-
singleError.allErrors = errors;
459-
throw singleError;
458+
const errorMessage = `${preErrorMsg}${errors.map(e => e.message || e).join(EOL)}`;
459+
const suppressCommandHelp = _.some(errors, (e: any) => e.suppressCommandHelp);
460+
this.$errors.fail({ formatStr: errorMessage, suppressCommandHelp });
460461
}
461462

462463
return result;

lib/services/project-changes-service.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import * as path from "path";
22
import { NativePlatformStatus, PACKAGE_JSON_FILE_NAME, APP_GRADLE_FILE_NAME, BUILD_XCCONFIG_FILE_NAME, PLATFORMS_DIR_NAME } from "../constants";
33
import { getHash, hook } from "../common/helpers";
4-
import { PrepareData } from "../data/prepare-data";
54

65
const prepareInfoFileName = ".nsprepareinfo";
76

@@ -51,7 +50,7 @@ export class ProjectChangesService implements IProjectChangesService {
5150
}
5251

5352
@hook("checkForChanges")
54-
public async checkForChanges(platformData: IPlatformData, projectData: IProjectData, prepareData: PrepareData): Promise<IProjectChangesInfo> {
53+
public async checkForChanges(platformData: IPlatformData, projectData: IProjectData, prepareData: IPrepareData): Promise<IProjectChangesInfo> {
5554
this._changesInfo = new ProjectChangesInfo();
5655
const isNewPrepareInfo = await this.ensurePrepareInfo(platformData, projectData, prepareData);
5756
if (!isNewPrepareInfo) {
@@ -158,7 +157,7 @@ export class ProjectChangesService implements IProjectChangesService {
158157
await this.savePrepareInfo(platformData, projectData, null);
159158
}
160159

161-
private async ensurePrepareInfo(platformData: IPlatformData, projectData: IProjectData, prepareData: PrepareData): Promise<boolean> {
160+
private async ensurePrepareInfo(platformData: IPlatformData, projectData: IProjectData, prepareData: IPrepareData): Promise<boolean> {
162161
this._prepareInfo = this.getPrepareInfo(platformData);
163162
if (this._prepareInfo) {
164163
const prepareInfoFile = path.join(platformData.projectRoot, prepareInfoFileName);

0 commit comments

Comments
 (0)