UNPKG

aws-spa

Version:

A no-brainer script to deploy a single page app on AWS

35 lines (26 loc) 990 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.predeployPrompt = void 0; var _inquirer = _interopRequireDefault(require("inquirer")); var _logger = require("./logger"); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const predeployPrompt = async (ciEnv, noPrompt) => { if (ciEnv || noPrompt) { return; } _logger.logger.info(`💡 If you don\'t want this message to prompt, either set CI=true in your env variables or use the "--noPrompt" option.`); const { continueDeploy } = await _inquirer.default.prompt([{ type: 'confirm', name: 'continueDeploy', message: "⚠️ It looks like you're attempting to deploy from a non CI environment. Are you sure you built the SPA correctly (env variables, run tests, ...)?\n\n", default: false }]); if (!continueDeploy) { throw new Error('👍 deploy aborted'); } }; exports.predeployPrompt = predeployPrompt;