"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
const commander = require("commander");
const uninstall_1 = require("../Api/uninstall");
const I18n_1 = require("../modules/I18n");
const Logger_1 = require("../modules/Logger");
commander
    .name('wiz uninstall')
    .description('wiz uninstall <components...>\n\naliases: rm')
    .parse(process.argv);
uninstall(commander.args)
    .catch((err) => Logger_1.default.error(err.message));
function uninstall(components = []) {
    return __awaiter(this, void 0, void 0, function* () {
        if (!components.length) {
            Logger_1.default.error(I18n_1.default.error('UNRESOLVED_ARGUMENTS'));
            Logger_1.default.info(I18n_1.default.info('UNINSTALL_USAGE_INFO'));
            return;
        }
        const cwd = process.cwd();
        const uninstallOptions = { cwd };
        const uninstallAction = yield uninstall_1.createAction(cwd);
        return uninstallAction(components, uninstallOptions);
    });
}
//# sourceMappingURL=wiz-uninstall.js.map