vtex
Version:
The platform for e-commerce apps
24 lines (23 loc) • 1.13 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const command_1 = require("@oclif/command");
const CustomCommand_1 = require("../api/oclif/CustomCommand");
const switch_1 = require("../api/modules/auth/switch");
const Colors_1 = require("../api/constants/Colors");
class Switch extends CustomCommand_1.CustomCommand {
async run() {
const { args: { account }, flags: { workspace }, } = this.parse(Switch);
await switch_1.switchAccount(account, { workspace, showWelcomeMessage: true });
}
}
exports.default = Switch;
Switch.description = `Switches to another ${Colors_1.ColorifyConstants.ID('VTEX account.')}`;
Switch.examples = [`${Colors_1.ColorifyConstants.COMMAND_OR_VTEX_REF('vtex switch')} storecomponents`];
Switch.flags = {
...CustomCommand_1.CustomCommand.globalFlags,
workspace: command_1.flags.string({
char: 'w',
description: `Moves to the specified ${Colors_1.ColorifyConstants.ID('workspace.')}`,
}),
};
Switch.args = [{ name: 'account', required: true, description: `${Colors_1.ColorifyConstants.ID('Account')} name to log in.` }];