@cto.ai/ops
Version:
💻 CTO.ai - The CLI built for Teams 🚀
25 lines (24 loc) • 958 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.genLogsURL = exports.isCommand = exports.checkPathOpsYmlExists = void 0;
const tslib_1 = require("tslib");
const fs = tslib_1.__importStar(require("fs-extra"));
const path = tslib_1.__importStar(require("path"));
const opConfig_1 = require("./../constants/opConfig");
const checkPathOpsYmlExists = (nameOrPath) => {
const pathToOpsYml = path.join(path.resolve(nameOrPath), opConfig_1.OP_FILE);
return fs.existsSync(pathToOpsYml);
};
exports.checkPathOpsYmlExists = checkPathOpsYmlExists;
const isCommand = (op) => {
return !!op.run;
};
exports.isCommand = isCommand;
const genLogsURL = (websiteURL, teamName, opType, opID, runID) => {
if (opType === 'workflow') {
opType = 'pipeline';
}
const opTypePlural = `${opType}s`;
return `${websiteURL}home/teams/${teamName}/${opTypePlural}/${opID}/${runID}`;
};
exports.genLogsURL = genLogsURL;