UNPKG

projex

Version:
38 lines (37 loc) 1.6 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const _api_1 = require("../../../api/index"); const _modules_1 = require("../../../modules/index"); const core_1 = require("@oclif/core"); const _shared_1 = require("../../../shared/index"); class Deploy extends core_1.Command { static description = `Deploy local files in the checkout of the current account`; static examples = [ `${_api_1.Colors.PINK(`${_shared_1.CLI_NAME} vtex cms deploy`)}`, `${_api_1.Colors.PINK(`${_shared_1.CLI_NAME} vtex cms deploy`)} my-site`, ]; static args = { extension: core_1.Args.string({ description: `Specify the account location to use. By default, the ${_api_1.Colors.GREEN('default')} account of VTEX is used. This is used when the account has multiple sub hosts.`, }), site: core_1.Args.string({ description: `Specify the site to deploy to. By default, the ${_api_1.Colors.GREEN('default')} site is used. This is used when the account has multiple sites.`, }), }; static flags = { ..._shared_1.globalFlags, yes: core_1.Flags.boolean({ description: 'Answer yes to all prompts.', char: 'y', default: false, required: false, }), }; async run() { const { args, flags } = await this.parse(Deploy); const { yes } = flags; const { site = _shared_1.VTEX_CMS_DEFAULT_SITE, extension } = args; await (0, _modules_1.deploy)(extension, site, { yes }); } } exports.default = Deploy;