31 lines
1.1 KiB
JavaScript
31 lines
1.1 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.register = void 0;
|
|
const chalk = require("chalk");
|
|
const argv_1 = require("../argv");
|
|
const lib_1 = require("../lib");
|
|
const modules_1 = require("../modules");
|
|
const dir = require("@xblox/fs/dir");
|
|
const options = (yargs) => (0, argv_1.defaultOptions)(yargs.option('command', {
|
|
describe: 'the command to run per module'
|
|
}));
|
|
const description = () => {
|
|
return 'Run a command for all modules' +
|
|
'\n\t Parameters : ' +
|
|
chalk.green('\n\t\t\t --command=[command to run]');
|
|
};
|
|
const register = (cli) => {
|
|
return cli.command('each', description(), options, (argv) => {
|
|
if (argv.help) {
|
|
return;
|
|
}
|
|
const args = (0, argv_1.sanitize)(argv);
|
|
if (args.target) {
|
|
dir.sync(args.target);
|
|
}
|
|
const modules = (0, modules_1.get)(args.source, args.target, args.profile);
|
|
const all = (0, lib_1.each)(modules, args);
|
|
});
|
|
};
|
|
exports.register = register;
|
|
//# sourceMappingURL=each.js.map
|