Skip to content

Commit 83d5274

Browse files
committed
fix: deprecate failWithoutHelp in favor of fail
1 parent 9d18551 commit 83d5274

File tree

87 files changed

+191
-191
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+191
-191
lines changed

lib/android-tools-info.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export class AndroidToolsInfo implements IAndroidToolsInfo {
132132
*/
133133
private printMessage(msg: string, additionalMsg?: string): void {
134134
if (this.showWarningsAsErrors) {
135-
this.$errors.failWithoutHelp(msg);
135+
this.$errors.fail(msg);
136136
} else {
137137
this.$logger.warn(msg);
138138
}
@@ -149,7 +149,7 @@ export class AndroidToolsInfo implements IAndroidToolsInfo {
149149
const installedTargets = this.getInstalledTargets();
150150
const androidCompileSdk = `${AndroidToolsInfo.ANDROID_TARGET_PREFIX}-${userSpecifiedCompileSdk}`;
151151
if (!_.includes(installedTargets, androidCompileSdk)) {
152-
this.$errors.failWithoutHelp(`You have specified '${userSpecifiedCompileSdk}' for compile sdk, but it is not installed on your system.`);
152+
this.$errors.fail(`You have specified '${userSpecifiedCompileSdk}' for compile sdk, but it is not installed on your system.`);
153153
}
154154

155155
this.selectedCompileSdk = userSpecifiedCompileSdk;

lib/commands/add-platform.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export class AddPlatformCommand extends ValidatePlatformCommandBase implements I
2727
this.$platformValidationService.validatePlatform(arg, this.$projectData);
2828

2929
if (!this.$platformValidationService.isPlatformSupportedForOS(arg, this.$projectData)) {
30-
this.$errors.failWithoutHelp(`Applications for platform ${arg} can not be built on this OS`);
30+
this.$errors.fail(`Applications for platform ${arg} can not be built on this OS`);
3131
}
3232

3333
const output = await super.canExecuteCommandBase(arg);

lib/commands/appstore-list.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class ListiOSApps implements ICommand {
1717

1818
public async execute(args: string[]): Promise<void> {
1919
if (!this.$platformValidationService.isPlatformSupportedForOS(this.$devicePlatformsConstants.iOS, this.$projectData)) {
20-
this.$errors.failWithoutHelp(`Applications for platform ${this.$devicePlatformsConstants.iOS} can not be built on this OS`);
20+
this.$errors.fail(`Applications for platform ${this.$devicePlatformsConstants.iOS} can not be built on this OS`);
2121
}
2222

2323
let username = args[0];

lib/commands/appstore-upload.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ export class PublishIOS implements ICommand {
7979

8080
public async canExecute(args: string[]): Promise<boolean> {
8181
if (!this.$hostInfo.isDarwin) {
82-
this.$errors.failWithoutHelp("iOS publishing is only available on Mac OS X.");
82+
this.$errors.fail("iOS publishing is only available on Mac OS X.");
8383
}
8484

8585
if (!this.$platformValidationService.isPlatformSupportedForOS(this.$devicePlatformsConstants.iOS, this.$projectData)) {
86-
this.$errors.failWithoutHelp(`Applications for platform ${this.$devicePlatformsConstants.iOS} can not be built on this OS`);
86+
this.$errors.fail(`Applications for platform ${this.$devicePlatformsConstants.iOS} can not be built on this OS`);
8787
}
8888

8989
return true;

lib/commands/build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export abstract class BuildCommandBase extends ValidatePlatformCommandBase {
3030

3131
protected validatePlatform(platform: string): void {
3232
if (!this.$platformValidationService.isPlatformSupportedForOS(platform, this.$projectData)) {
33-
this.$errors.failWithoutHelp(`Applications for platform ${platform} can not be built on this OS`);
33+
this.$errors.fail(`Applications for platform ${platform} can not be built on this OS`);
3434
}
3535
}
3636

lib/commands/debug.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export class DebugPlatformCommand extends ValidatePlatformCommandBase implements
6060
this.$androidBundleValidatorHelper.validateNoAab();
6161

6262
if (!this.$platformValidationService.isPlatformSupportedForOS(this.platform, this.$projectData)) {
63-
this.$errors.failWithoutHelp(`Applications for platform ${this.platform} can not be built on this OS`);
63+
this.$errors.fail(`Applications for platform ${this.platform} can not be built on this OS`);
6464
}
6565

6666
if (this.$options.release) {
@@ -105,18 +105,18 @@ export class DebugIOSCommand implements ICommand {
105105

106106
public async canExecute(args: string[]): Promise<ICanExecuteCommandOutput> {
107107
if (!this.$platformValidationService.isPlatformSupportedForOS(this.$devicePlatformsConstants.iOS, this.$projectData)) {
108-
this.$errors.failWithoutHelp(`Applications for platform ${this.$devicePlatformsConstants.iOS} can not be built on this OS`);
108+
this.$errors.fail(`Applications for platform ${this.$devicePlatformsConstants.iOS} can not be built on this OS`);
109109
}
110110

111111
const isValidTimeoutOption = this.isValidTimeoutOption();
112112
if (!isValidTimeoutOption) {
113-
this.$errors.failWithoutHelp(`Timeout option must be a number.`);
113+
this.$errors.fail(`Timeout option specifies the seconds NativeScript CLI will wait to find the inspector socket port from device's logs. Must be a number.`);
114114
}
115115

116116
if (this.$options.inspector) {
117117
const macOSWarning = await this.$sysInfo.getMacOSWarningMessage();
118118
if (macOSWarning && macOSWarning.severity === SystemWarningsSeverity.high) {
119-
this.$errors.failWithoutHelp(`You cannot use NativeScript Inspector on this OS. To use it, please update your OS.`);
119+
this.$errors.fail(`You cannot use NativeScript Inspector on this OS. To use it, please update your OS.`);
120120
}
121121
}
122122
const result = await this.debugPlatformCommand.canExecute(args);

lib/commands/generate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class GenerateCommand implements ICommand {
1212
try {
1313
await run(this.executionOptions);
1414
} catch (error) {
15-
this.$errors.failWithoutHelp(error.message);
15+
this.$errors.fail(error.message);
1616
}
1717
}
1818

lib/commands/plugin/add-plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class AddPluginCommand implements ICommand {
1919
const installedPlugins = await this.$pluginsService.getAllInstalledPlugins(this.$projectData);
2020
const pluginName = args[0].toLowerCase();
2121
if (_.some(installedPlugins, (plugin: IPluginData) => plugin.name.toLowerCase() === pluginName)) {
22-
this.$errors.failWithoutHelp(`Plugin "${pluginName}" is already installed.`);
22+
this.$errors.fail(`Plugin "${pluginName}" is already installed.`);
2323
}
2424

2525
return true;

lib/commands/plugin/build-plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export class BuildPluginCommand implements ICommand {
5454

5555
public async canExecute(args: string[]): Promise<boolean> {
5656
if (!this.$fs.exists(path.join(this.pluginProjectPath, constants.PLATFORMS_DIR_NAME, "android"))) {
57-
this.$errors.failWithoutHelp("No plugin found at the current directory, or the plugin does not need to have its platforms/android components built into an `.aar`.");
57+
this.$errors.fail("No plugin found at the current directory, or the plugin does not need to have its platforms/android components built into an `.aar`.");
5858
}
5959

6060
return true;

lib/commands/plugin/create-plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export class CreatePluginCommand implements ICommand {
9292
this.$fs.createDirectory(projectDir);
9393

9494
if (this.$fs.exists(projectDir) && !this.$fs.isEmptyDir(projectDir)) {
95-
this.$errors.failWithoutHelp(this.pathAlreadyExistsMessageTemplate, projectDir);
95+
this.$errors.fail(this.pathAlreadyExistsMessageTemplate, projectDir);
9696
}
9797
}
9898

0 commit comments

Comments
 (0)