Skip to content

Do not track help command when other command fails #3196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/commands/generate-help.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export class GenerateHelpCommand implements ICommand {
public allowedParameters: ICommandParameter[] = [];

constructor(private $htmlHelpService: IHtmlHelpService) { }
constructor(private $helpService: IHelpService) { }

public async execute(args: string[]): Promise<void> {
return this.$htmlHelpService.generateHtmlPages();
return this.$helpService.generateHtmlPages();
}
}

Expand Down
4 changes: 2 additions & 2 deletions lib/commands/post-install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ export class PostInstallCliCommand extends PostInstallCommand {
private $subscriptionService: ISubscriptionService,
$staticConfig: Config.IStaticConfig,
$commandsService: ICommandsService,
$htmlHelpService: IHtmlHelpService,
$helpService: IHelpService,
$options: ICommonOptions,
$doctorService: IDoctorService,
$analyticsService: IAnalyticsService,
$logger: ILogger) {
super($fs, $staticConfig, $commandsService, $htmlHelpService, $options, $doctorService, $analyticsService, $logger);
super($fs, $staticConfig, $commandsService, $helpService, $options, $doctorService, $analyticsService, $logger);
}

public async execute(args: string[]): Promise<void> {
Expand Down
4 changes: 0 additions & 4 deletions lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ export class StaticConfig extends StaticConfigBase implements IStaticConfig {

public version = require("../package.json").version;

public get helpTextPath(): string {
return path.join(__dirname, "../resources/help.txt");
}

public get HTML_CLI_HELPERS_DIR(): string {
return path.join(__dirname, "../docs/helpers");
}
Expand Down
2 changes: 1 addition & 1 deletion test/commands/post-install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const createTestInjector = (): IInjector => {
tryExecuteCommand: async (commandName: string, commandArguments: string[]): Promise<void> => undefined
});

testInjector.register("htmlHelpService", {
testInjector.register("helpService", {
generateHtmlPages: async (): Promise<void> => undefined
});

Expand Down
5 changes: 4 additions & 1 deletion test/platform-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class ErrorsNoFailStub implements IErrors {
throw new Error();
}

async beginCommand(action: () => Promise<boolean>, printHelpCommand: () => Promise<boolean>): Promise<boolean> {
async beginCommand(action: () => Promise<boolean>, printHelpCommand: () => Promise<void>): Promise<boolean> {
let result = false;
try {
result = await action();
Expand Down Expand Up @@ -148,6 +148,9 @@ function createTestInjector() {
});
testInjector.register("messages", Messages);
testInjector.register("devicePathProvider", {});
testInjector.register("helpService", {
showCommandLineHelp: async (): Promise<void> => (undefined)
});

return testInjector;
}
Expand Down
3 changes: 3 additions & 0 deletions test/platform-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ function createTestInjector() {
});
testInjector.register("messages", Messages);
testInjector.register("devicePathProvider", {});
testInjector.register("helpService", {
showCommandLineHelp: async (): Promise<void> => (undefined)
});

return testInjector;
}
Expand Down
3 changes: 3 additions & 0 deletions test/plugins-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ function createTestInjector() {
});
testInjector.register("xmlValidator", XmlValidator);
testInjector.register("config", StaticConfigLib.Configuration);
testInjector.register("helpService", {
showCommandLineHelp: async (): Promise<void> => (undefined)
});

return testInjector;
}
Expand Down
2 changes: 1 addition & 1 deletion test/stubs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export class ErrorsStub implements IErrors {
throw new Error(message);
}

async beginCommand(action: () => Promise<boolean>, printHelpCommand: () => Promise<boolean>): Promise<boolean> {
async beginCommand(action: () => Promise<boolean>, printHelpCommand: () => Promise<void>): Promise<boolean> {
throw new Error("not supported");
}

Expand Down