vtex
Version:
The platform for e-commerce apps
31 lines (30 loc) • 1.29 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const command_1 = require("@oclif/command");
const CustomCommand_1 = require("../api/oclif/CustomCommand");
const browse_1 = tslib_1.__importDefault(require("../modules/browse"));
const Colors_1 = require("../api/constants/Colors");
class Browse extends CustomCommand_1.CustomCommand {
async run() {
const { args: { path }, flags: { qr }, } = this.parse(Browse);
await browse_1.default(path, { qr });
}
}
exports.default = Browse;
Browse.description = `Opens the URL relative to your current ${Colors_1.ColorifyConstants.ID('workspace')} and ${Colors_1.ColorifyConstants.ID('account')} in a new browser window.`;
Browse.examples = [
`${Colors_1.ColorifyConstants.COMMAND_OR_VTEX_REF('vtex browse')}`,
`${Colors_1.ColorifyConstants.COMMAND_OR_VTEX_REF('vtex browse')} admin`,
];
Browse.flags = {
...CustomCommand_1.CustomCommand.globalFlags,
qr: command_1.flags.boolean({ char: 'q', description: 'Prints a QR Code on the terminal.' }),
};
Browse.args = [
{
name: 'path',
default: '',
description: `Relative path from ${Colors_1.ColorifyConstants.ID('https://{workspace}--{account}.myvtex.com/.')}`,
},
];