UNPKG

projex

Version:
32 lines (31 loc) 1.23 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const _api_1 = require("../../api/index"); const _modules_1 = require("../../modules/index"); const core_1 = require("@oclif/core"); const _shared_1 = require("../../shared/index"); class Browse extends core_1.Command { static description = `Run a command in the current directory or select multiple directories`; static examples = [ `${_api_1.Colors.PINK(`${_shared_1.CLI_NAME} bash run`)} 'git add . && git push'`, `${_api_1.Colors.PINK(`${_shared_1.CLI_NAME} bash run`)} 'npm install'`, ]; static flags = { ..._shared_1.globalFlags, list: core_1.Flags.boolean({ description: 'List all projects before running the command.', char: 'l', default: false, }), }; static args = { command: core_1.Args.string({ description: `Specify the command to run. For example: ${_api_1.Colors.GREEN('git add . && git push')}`, }), }; async run() { const { flags: { list }, args: { command }, } = await this.parse(Browse); await (0, _modules_1.bashRunCommand)(command, { list }); } } exports.default = Browse;