cli-stash
Version:
CLI application to manage and work with Atlassian Stash. Work with your Stash project and repositories from Command lines.
35 lines (34 loc) • 1.31 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const baseCommand_1 = require("../../libs/core/baseCommand");
const stashResponse_1 = require("../../libs/core/stashResponse");
const tables_1 = require("../../libs/core/tables");
class Logout extends baseCommand_1.BaseCommand {
async run() {
const { alias } = this.flags;
const response = new stashResponse_1.StashCLIResponse();
if (this.localConfig.instances && this.localConfig.instances[alias]) {
delete this.localConfig.instances[alias];
}
this.localConfig.save();
const message = 'Instace with alias ' + alias + ' logout successfully';
response.status = 0;
response.message = message;
response.result = this.localConfig.instances[alias];
this.ux.table([response.result], tables_1.InstanceColumns, {
csv: this.flags.csv,
});
return response;
}
}
exports.default = Logout;
Logout.loginRequired = false;
Logout.description = 'Logout againts Stash instance.';
Logout.examples = [
`$ stash auth:logout -a "Alias" --json`,
`$ stash auth:logout -a "Alias"`,
];
Logout.flags = {
...baseCommand_1.BaseCommand.flags,
alias: baseCommand_1.BuildFlags.alias,
};