UNPKG

@boostercloud/cli

Version:

CLI of the Booster Framework, the next level of abstraction for cloud-native applications

20 lines (19 loc) 848 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.initializeEnvironment = initializeEnvironment; exports.currentEnvironment = currentEnvironment; function initializeEnvironment(logger, environment) { // We override the environment with the one passed via flags if (environment) { process.env.BOOSTER_ENV = environment; } // If the resulting environment is not set, the user didn't provide an environment and it's not configured in the OS if (!currentEnvironment()) { logger.error('Error: No environment set. Use the flag `-e` or set the environment variable BOOSTER_ENV to set it before running this command. Example usage: `boost deploy -e <environment>`.'); return false; } return true; } function currentEnvironment() { return process.env.BOOSTER_ENV; }