forked from oclif/plugin-plugins
-
Notifications
You must be signed in to change notification settings - Fork 1
/
link.ts
35 lines (27 loc) · 955 Bytes
/
link.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { Command, flags } from "@oclif/command";
import chalk from "chalk";
import cli from "cli-ux";
import { ColorifyConstants } from "vtex";
import Plugins from "../../modules/plugins";
export default class PluginsLink extends Command {
static description = "Links a plugin into the CLI for development.";
static usage = "plugins link PLUGIN";
static examples = [
`${ColorifyConstants.COMMAND_OR_VTEX_REF("vtex plugins link")} myplugin`,
];
static args = [
{ name: "path", description: "Plugin path.", required: true, default: "." },
];
static flags = {
help: flags.help({ char: "h" }),
verbose: flags.boolean({ char: "v" }),
};
plugins = new Plugins(this.config);
async run() {
const { flags, args } = this.parse(PluginsLink);
this.plugins.verbose = flags.verbose;
cli.action.start(`Linking plugin ${chalk.cyan(args.path)}`);
await this.plugins.link(args.path);
cli.action.stop();
}
}