@mail-core/cli
Version:
Инструментарий для написания cli-скриптов
44 lines • 1.5 kB
JavaScript
;
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.local = void 0;
const path_1 = require("path");
require("child_process");
const command_1 = require("../../../command/command");
const pkg_1 = require("../../../pkg");
const run_1 = require("../run");
exports.local = command_1.createCommand({
name: 'local',
describe: 'Local run cli-command',
options: {
cmd: {
desc: 'Command name',
type: 'string',
positional: true,
interactive: true,
demandOption: true,
},
args: {
desc: 'Arguments',
array: true,
type: 'string',
default: [],
positional: true,
},
},
async handler(_a, { console }) {
var { cmd, args } = _a, rest = __rest(_a, ["cmd", "args"]);
await run_1.runFile(console, path_1.resolve(pkg_1.ROOT_DIR, 'cli'), [cmd].concat(args), rest);
},
});
//# sourceMappingURL=index.js.map