UNPKG

@cto.ai/ops

Version:

💻 CTO.ai Ops - The CLI built for Teams 🚀

21 lines (20 loc) • 763 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const base_1 = tslib_1.__importDefault(require("../../base")); 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 get_docker_1.default(base_1.default, command); } } catch (err) { this.debug('%O', err); await this.config.runHook('error', { err }); } }; exports.default = hook;