appcenter-cli
Version:
Command line tool for Visual Studio App Center
36 lines (29 loc) • 924 B
text/typescript
import { AppCommand, CommandArgs, CommandResult,
help, success, longName, required, hasArg } from "../../util/commandline";
import { AppCenterClient, clientCall } from "../../util/apis";
import { Messages } from "./lib/help-messages";
(Messages.TestCloud.Commands.Stop)
export default class StopCommand extends AppCommand {
(Messages.TestCloud.Arguments.StopTestRunId)
("test-run-id")
testRunId: string;
constructor(args: CommandArgs) {
super(args);
}
async run(client: AppCenterClient): Promise<CommandResult> {
await this.stopTestRun(client, this.testRunId);
return success();
}
private stopTestRun(client: AppCenterClient, testRunId: string): Promise<VoidFunction> {
return clientCall((cb) => {
client.test.stopTestRun(
testRunId,
this.app.ownerName,
this.app.appName,
cb
);
});
}
}