UNPKG

ryuu

Version:

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

53 lines 2.34 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var inquirer = require("inquirer"); var manifest_1 = require("../util/manifest"); var login_1 = require("../util/login"); var log_1 = require("../util/log"); var appStructure = require("../util/appStructure"); var index_1 = require("../models/index"); module.exports = function (program) { program .command('release') .description('prepare a design for app store release') .action(function () { new login_1.Login().getClient().then(function (client) { var manifest = manifest_1.ManifestUtils.getManifest(program.opts().manifest, true); // make sure app has been published first if (!manifest.id) { log_1.log.fail("Can't release until design is published.", 'Please publish your Custom App design (with the `domo publish` command) first'); } // make sure there is a thumbnail.png when releasing if (!appStructure.hasThumbnail()) { log_1.log.fail(index_1.constant.THUMBNAIL_CREATE_WARNING, index_1.constant.CREATE_THUMBNAIL); } // prompt the user for which design version they want to release, defaulting to latest client .getVersions(manifest.id) .then(function (versions) { versions.reverse(); versions.unshift('latest'); inquirer .prompt([ { type: 'list', message: 'select a version to release', name: 'version', choices: versions, }, ]) .then(function (answers) { // release the kraken client .release(manifest.id, answers.version) .then(function () { return log_1.log.ok('Design version (' + answers.version + ') released'); }) .catch(log_1.log.fail); }); }) .catch(function () { return log_1.log.clientRequestFailed('Error releasing app design'); }); }); }); }; //# sourceMappingURL=release.js.map