UNPKG

datapack-manager

Version:
38 lines (33 loc) 1.04 kB
#!/usr/bin/env node 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var _tslib = require('../_virtual/_tslib.js'); var index = require('../index.js'); const command = ["install <pack> <world>", "i"]; const desc = "Install a datapack"; function builder(yargs) { return yargs.options({ mode: { desc: "Install mode", alias: "m", choices: ["symlink", "copy", "compile", "move"], default: "symlink" } }); } function handler({ mode, pack, world }) { var _a; return _tslib.__awaiter(this, void 0, void 0, function* () { const manager = new index.DatapackManager(); try { yield manager.install(pack, world, { mode }); } catch (e) { console.error((_a = e === null || e === void 0 ? void 0 : e.message) !== null && _a !== void 0 ? _a : e); } }); } exports.builder = builder; exports.command = command; exports.desc = desc; exports.handler = handler;