@sap/cli-core
Version:
Command-Line Interface (CLI) Core Module
16 lines (15 loc) • 616 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.create = void 0;
const config_1 = require("../../../../config");
const commands_1 = require("../../../../utils/commands");
const types_1 = require("./types");
const utils_1 = require("./utils");
const create = () => async (command) => {
command.addOption(await (0, commands_1.buildOption)(command, types_1.OPTION_SECRET));
return async () => {
const token = await (0, utils_1.getTechnicalJwt)();
(0, config_1.set)({ authorization: { Authorization: `Bearer ${token}` } });
};
};
exports.create = create;