UNPKG

@kintone/plugin-packer

Version:

Package your kintone plugin with pure JavaScript

50 lines (49 loc) 1.47 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const meow_1 = __importDefault(require("meow")); const packer_cli_1 = __importDefault(require("./packer-cli")); const USAGE = "$ kintone-plugin-packer [options] PLUGIN_DIR"; const cli = (0, meow_1.default)(` Usage ${USAGE} Options --ppk PPK_FILE: Private key file. If omitted, it's generated into '<Plugin ID>.ppk' in the same directory of PLUGIN_DIR. --out PLUGIN_FILE: The default is 'plugin.zip' in the same directory of PLUGIN_DIR. --watch: Watch PLUGIN_DIR for the changes. `, { flags: { ppk: { type: "string", }, out: { type: "string", }, watch: { type: "boolean", alias: "w", }, }, }); const pluginDir = cli.input[0]; if (!pluginDir) { console.error("Error: An argument `PLUGIN_DIR` is required."); cli.showHelp(); } const { ppk, out, watch } = cli.flags; if (process.env.NODE_ENV === "test") { const flags = { watch: watch !== null && watch !== void 0 ? watch : false }; if (ppk) { flags.ppk = ppk; } if (out) { flags.out = out; } console.log(JSON.stringify({ pluginDir, flags })); } else { (0, packer_cli_1.default)(pluginDir, { ppk, out, watch }); } //# sourceMappingURL=cli.js.map