"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.checkStage = void 0;
const chalk_1 = __importDefault(require("chalk"));
const read_config_1 = require("../config/read-config");
const logger_1 = require("../utils/logger");
exports.checkStage = (cmd) => {
    const config = new read_config_1.ConfigReader(new logger_1.Logger()).readConfig();
    if (!config.stages) {
        console.warn(chalk_1.default.yellow('Info: Allowed stages not given in config, considering every stage valid.'));
    }
    if (config.stages && !config.stages.includes(cmd)) {
        console.info(`\n${chalk_1.default.red('✖')} Unknown stage`, cmd);
        process.exit(1);
    }
    console.info(`\n${chalk_1.default.green('✔')} Valid stage`, cmd);
    process.exit(0);
};
//# sourceMappingURL=check-stage.js.map