UNPKG

@sap/cli-core

Version:

Command-Line Interface (CLI) Core Module

18 lines (17 loc) 778 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.create = void 0; const logger_1 = require("../../../logger"); const utils_1 = require("../../../utils/utils"); const utils_2 = require("./utils"); /* jscpd:ignore-start */ const create = (option) => async () => async () => { const { debug } = (0, logger_1.get)("commands.handler.options.env"); /* jscpd:ignore-end */ debug(`reading option ${option.longName} from env`); if (!process.env[(0, utils_1.toConstantCase)(option.longName)]) { throw new Error(`env variable process.env.${(0, utils_1.toConstantCase)(option.longName)} is not set`); } (0, utils_2.setOption)(option, process.env[(0, utils_1.toConstantCase)(option.longName)]); }; exports.create = create;