"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const commander_1 = require("commander");
const actions_1 = require("./actions");
const checkLocalBranch_1 = require("./helpers/checkLocalBranch");
const helpers_1 = require("./helpers");
const program = new commander_1.Command();
program
    .command("current-deployed-version <namespace> <component>")
    .description("Gets the currently-deployed version for a svc-component")
    .action((namespace, component) => {
    actions_1.currentDeployedVersion(component, namespace);
});
program
    .command("post-to-slack <channelId> <prevVersion> <currentVersion> <namespace> <user> <buildRun>")
    .description("Posts changelog and build-details for a CI-run to slack")
    .action((channelId, prevVersion, currentVersion, namespace, user, buildRun) => {
    return actions_1.postChangelogToSlack(process.env.SLACK_TOKEN, channelId, prevVersion, currentVersion, namespace, user, buildRun);
});
program
    .command("npm-publish [dir]")
    .description("Publish package to npm")
    .action(dir => {
    const { currentBranch } = checkLocalBranch_1.checkLocalBranch(dir || ".");
    return actions_1.npmPublish(currentBranch);
});
program
    .command("bump [dir] [tagPrefix] [ticketPattern] [extraCommitMessage]")
    .description("Bump version with standard version")
    .action((dir, tagPrefix, ticketPattern, extraCommitMessage) => {
    const { branch } = checkLocalBranch_1.checkLocalBranch(dir || ".");
    const lastCommitMsg = helpers_1.exec("git log -1 --pretty=%B").stdout;
    return actions_1.bump(tagPrefix || "v", ticketPattern || "SHTL", branch, lastCommitMsg, extraCommitMessage);
});
program.parse(process.argv);
//# sourceMappingURL=index.js.map