UNPKG

@webresto/cli

Version:

Webresto command line interface

29 lines (28 loc) 1.06 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.publish = void 0; const fs_1 = __importDefault(require("fs")); const async_shelljs_1 = require("async-shelljs"); const publish_1 = __importDefault(require("module-registry-client-lib/lib/publish")); const publish = async (module, options) => { // if (debug) { async_shelljs_1.config.silent = false; // } else { // config.silent = true; // } let currentModulePath = ''; if (module) { currentModulePath = process.cwd() + '/modules/' + module; } else { if (!fs_1.default.existsSync(process.cwd() + '/package.json')) throw `in not package`; currentModulePath = process.cwd(); } let userToken = process.env.WEBRESTO_REGISTRY_TOKEN; await (0, publish_1.default)(currentModulePath, userToken, options.tag ?? 'main', 'test note'); }; exports.publish = publish;