@cto.ai/ops
Version:
💻 CTO.ai - The CLI built for Teams 🚀
20 lines (19 loc) • 697 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const get_docker_1 = tslib_1.__importDefault(require("./../../utils/get-docker"));
const hook = async function (opts) {
try {
const command = opts.Command.id;
// not including `run` here because local ops work without Docker
const dockerDependentCommands = ['publish', 'build', 'cleanup'];
if (dockerDependentCommands.includes(command)) {
await (0, get_docker_1.default)(this, command);
}
}
catch (err) {
this.debug('%O', err);
await this.config.runHook('error', { err });
}
};
exports.default = hook;