@tucmc/hazel
Version:
Clubs Data Processing Framework
31 lines (30 loc) • 1.22 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const commander_1 = require("commander");
const lib_1 = require("../lib");
const init_1 = require("./init");
const run_1 = require("./run");
const cli = new commander_1.Command();
cli
.version(lib_1.VERSION)
.description('Hazel CLI can be used to run or init single-file hazel script without the creation of node project.')
.name('hazel');
cli
.command('run')
.description('Run a provided single hazel script.')
.argument('<file>', 'file path')
.option('-f, --force', 'Force version exclusive scripts to run with incompatible version.', false)
.option('-s, --string', 'Run the script as string instead of file.', false)
.action((filePath, options) => {
(0, run_1.runScript)(filePath, options);
});
cli
.command('init')
.description('Init a single hazel script file.')
.option('-n, --name <filename>', 'File name or file path. If did not specify, console will prompt the question.', '')
.option('--version-exclusive', 'Make the script exclusive for current version.', false)
.action((options) => {
(0, init_1.initScript)(options);
});
cli.parse(process.argv);