UNPKG

ryuu

Version:

Domo App Dev Studio CLI, The main tool used to create, edit, and publish app designs to Domo

36 lines 1.29 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getDesignId = void 0; var manifest_1 = require("../util/manifest"); var log_1 = require("../util/log"); var validator_1 = require("validator"); /** * Takes up to two args to check for a valid design id and gives priority to * the first argument * @param {String} arg1 designId arg that will take priority if both args * are defined and valid * @param {String} man object defining the program manifest of the current * context * @return {String} Returns id with this priority: arg1, arg2, * manifest.id, null * @return {void} Returns void with an error log. */ function getDesignId(id, manifestPath) { if (id) { if (!validator_1.default.isUUID(id)) { log_1.log.fail("The argument ".concat(id, " is not a valid design ID")); return; } } else { var manifest = manifest_1.ManifestUtils.getManifest(manifestPath); if (!manifest || !manifest.id) { log_1.log.fail('No manifest found. Please supply design id using -i or change to a directory with a valid manifest file'); return; } id = manifest.id; } return id; } exports.getDesignId = getDesignId; //# sourceMappingURL=design.js.map