UNPKG

@lcap/cli

Version:

utils for lcap

53 lines 1.73 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.registerCommand = void 0; const utils_1 = require("../utils"); const api_1 = require("./api"); function registerCommand(yargs) { yargs.command('bump', '升级 Nasl 包版本', (yargs) => { yargs .options(utils_1.tokenOptions) .option('type', { type: 'string', describe: '升级版本类别', choices: ['prerelease', 'release'], default: 'prerelease', }) .option('targetBranch', { type: 'string', describe: '合并到哪个分支', default: 'test', }) .option('exclude', { type: 'array', describe: '不发包的子包名称', default: [], }) .option('output', { type: 'string', describe: '结果储存文件', }) .option('onlyPrintNaslName', { type: 'boolean', describe: '仅输出包名', default: false, }) .check((argv) => { if (argv.onlyPrintNaslName) { return true; } return (0, utils_1.tokenCheck)(argv); }); }, (argv) => { if (argv.onlyPrintNaslName) { (0, api_1.printNaslName)(process.cwd(), argv).then((msg) => console.log(msg)); return; } return (0, api_1.bumpCommand)(process.cwd(), argv).catch((err) => { utils_1.logger.error(err.cause?.description ?? err.message); process.exit(1); }); }); } exports.registerCommand = registerCommand; //# sourceMappingURL=command.js.map