@lark-project/cli
Version:
飞书项目插件开发工具
32 lines (31 loc) • 1.22 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.addConfigCommand = void 0;
const path_1 = __importDefault(require("path"));
const types_1 = require("../../types");
const run_script_1 = __importDefault(require("../../utils/run-script"));
function addConfigCommand(program) {
program
.command('config')
.alias('c')
.description('Set or get config of plugin')
.argument('<operate>', 'Specify the operate type, e.g. get, set.')
.argument('[key]', 'Specify the key in the plugin configuration.')
.argument('[value]', 'Specify the value of the key in the plugin configuration')
.action(async (operate, key, value, options) => {
(0, run_script_1.default)(path_1.default.join(__dirname, '../dispatcher'), [
'--command',
types_1.ECommandName.config,
'--payload',
JSON.stringify({
operate,
key,
value,
}),
]);
});
}
exports.addConfigCommand = addConfigCommand;