ogit
Version:
A lazy developer's Git CLI made simple. Makes using git on cloud IDEs (i.e. C9) a walk in the park.
45 lines (44 loc) • 1.66 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
require("reflect-metadata");
const git_1 = require("../wrapper/git");
const command_1 = require("@oclif/command");
const inquirer = require("inquirer");
class CreateTagCommand extends command_1.Command {
run() {
return tslib_1.__awaiter(this, void 0, void 0, function* () {
const prompts = [
{
message: 'Please enter the name of the tag',
type: 'input',
name: 'tag',
validate: (tagName) => {
return tagName && tagName.length > 0;
}
},
{
message: 'Please enter the commit message',
type: 'input',
name: 'message',
validate: (message) => {
return message && message.length > 0;
}
},
{
message: 'Would you like to push the tag to origin?',
type: 'confirm',
name: 'immediatePush',
default: false
}
];
const answers = yield inquirer.prompt(prompts);
yield git_1.GitFacade.addTag(answers.tag, answers.message);
if (answers.immediatePush) {
yield git_1.GitFacade.pushTag(answers.tag);
}
});
}
}
CreateTagCommand.description = 'Tags the current repository. Does annotated tagging only';
exports.default = CreateTagCommand;