@oclif/plugin-which 2.1.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/lib/commands/which.js +8 -2
- package/oclif.manifest.json +1 -1
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ $ npm install -g @oclif/plugin-which
|
|
|
20
20
|
$ oclif-example COMMAND
|
|
21
21
|
running command...
|
|
22
22
|
$ oclif-example (--version)
|
|
23
|
-
@oclif/plugin-which/2.
|
|
23
|
+
@oclif/plugin-which/2.2.0 linux-x64 node-v18.12.0
|
|
24
24
|
$ oclif-example --help [COMMAND]
|
|
25
25
|
USAGE
|
|
26
26
|
$ oclif-example COMMAND
|
|
@@ -43,5 +43,5 @@ DESCRIPTION
|
|
|
43
43
|
Show which plugin a command is in.
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
_See code: [src/commands/which.ts](https://github.com/oclif/plugin-which/blob/v2.
|
|
46
|
+
_See code: [src/commands/which.ts](https://github.com/oclif/plugin-which/blob/v2.2.0/src/commands/which.ts)_
|
|
47
47
|
<!-- commandsstop -->
|
package/lib/commands/which.js
CHANGED
|
@@ -4,8 +4,14 @@ const core_1 = require("@oclif/core");
|
|
|
4
4
|
class Which extends core_1.Command {
|
|
5
5
|
async run() {
|
|
6
6
|
const { argv } = await this.parse(Which);
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
let command = argv;
|
|
8
|
+
if (argv.length === 1 && typeof argv[0] === 'string') {
|
|
9
|
+
// If this if statement is true then the command to find was passed in as a single string, e.g. `mycli which "my command"`
|
|
10
|
+
// So we must use the topicSeparator to split it into an array
|
|
11
|
+
command = argv[0].split(this.config.topicSeparator);
|
|
12
|
+
}
|
|
13
|
+
const cmd = this.config.findCommand(command.join(':'), { must: true });
|
|
14
|
+
core_1.CliUx.ux.styledHeader(command.join(this.config.topicSeparator));
|
|
9
15
|
core_1.CliUx.ux.styledObject({
|
|
10
16
|
plugin: cmd.pluginName,
|
|
11
17
|
}, ['plugin']);
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"2.
|
|
1
|
+
{"version":"2.2.0","commands":{"which":{"id":"which","description":"Show which plugin a command is in.","strict":false,"pluginName":"@oclif/plugin-which","pluginAlias":"@oclif/plugin-which","pluginType":"core","aliases":[],"flags":{},"args":[]}}}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oclif/plugin-which",
|
|
3
3
|
"description": "find which plugin a command is in",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.2.0",
|
|
5
5
|
"author": "Salesforce",
|
|
6
6
|
"bugs": "https://github.com/oclif/plugin-which/issues",
|
|
7
7
|
"dependencies": {
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
"tslib": "^2.4.0"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
|
-
"@oclif/plugin-help": "^5.1.
|
|
13
|
-
"@oclif/test": "^2.2.
|
|
12
|
+
"@oclif/plugin-help": "^5.1.17",
|
|
13
|
+
"@oclif/test": "^2.2.6",
|
|
14
14
|
"@types/chai": "^4.3.1",
|
|
15
15
|
"@types/mocha": "^9",
|
|
16
|
-
"@types/node": "^14.18.
|
|
16
|
+
"@types/node": "^14.18.33",
|
|
17
17
|
"chai": "^4.2.0",
|
|
18
18
|
"eslint": "^7.32.0",
|
|
19
19
|
"eslint-config-oclif": "^4.0.0",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"mocha": "^9",
|
|
23
23
|
"nyc": "^15.1.0",
|
|
24
24
|
"oclif": "^2.6.3",
|
|
25
|
+
"shx": "^0.3.4",
|
|
25
26
|
"ts-node": "^9.0.0",
|
|
26
27
|
"typescript": "4.6.4"
|
|
27
28
|
},
|
|
@@ -46,14 +47,14 @@
|
|
|
46
47
|
},
|
|
47
48
|
"repository": "oclif/plugin-which",
|
|
48
49
|
"scripts": {
|
|
49
|
-
"postpack": "rm -f oclif.manifest.json",
|
|
50
|
+
"postpack": "shx rm -f oclif.manifest.json",
|
|
50
51
|
"posttest": "yarn lint",
|
|
51
52
|
"prepack": "yarn build && oclif manifest . && oclif readme",
|
|
52
53
|
"test": "mocha --forbid-only \"test/**/*.test.ts\"",
|
|
53
54
|
"version": "oclif readme && git add README.md",
|
|
54
55
|
"lint": "eslint . --ext .ts --config .eslintrc",
|
|
55
56
|
"pretest": "yarn build && tsc -p test --noEmit",
|
|
56
|
-
"build": "rm -rf lib && tsc"
|
|
57
|
+
"build": "shx rm -rf lib && tsc"
|
|
57
58
|
},
|
|
58
59
|
"main": "lib/index.js"
|
|
59
60
|
}
|