@oclif/core 1.9.0 → 1.9.1
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/CHANGELOG.md +7 -0
- package/lib/config/plugin.js +2 -1
- package/lib/help/index.js +3 -1
- package/lib/main.js +5 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.9.1](https://github.com/oclif/core/compare/v1.9.0...v1.9.1) (2022-06-14)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* support CLIs with single top level command ([#426](https://github.com/oclif/core/issues/426)) ([44adb4d](https://github.com/oclif/core/commit/44adb4d387695548a017b38249b0bc3453aedbdf))
|
|
11
|
+
|
|
5
12
|
## [1.9.0](https://github.com/oclif/core/compare/v1.8.2...v1.9.0) (2022-05-20)
|
|
6
13
|
|
|
7
14
|
|
package/lib/config/plugin.js
CHANGED
|
@@ -159,7 +159,8 @@ class Plugin {
|
|
|
159
159
|
const p = path.parse(file);
|
|
160
160
|
const topics = p.dir.split('/');
|
|
161
161
|
const command = p.name !== 'index' && p.name;
|
|
162
|
-
|
|
162
|
+
const id = [...topics, command].filter(f => f).join(':');
|
|
163
|
+
return id === '' ? '.' : id;
|
|
163
164
|
});
|
|
164
165
|
this._debug('found commands', ids);
|
|
165
166
|
return ids;
|
package/lib/help/index.js
CHANGED
|
@@ -77,8 +77,10 @@ class Help extends HelpBase {
|
|
|
77
77
|
if (!subject) {
|
|
78
78
|
if (this.config.pjson.oclif.default) {
|
|
79
79
|
const rootCmd = this.config.findCommand(this.config.pjson.oclif.default);
|
|
80
|
-
if (rootCmd)
|
|
80
|
+
if (rootCmd) {
|
|
81
81
|
await this.showCommandHelp(rootCmd);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
82
84
|
}
|
|
83
85
|
await this.showRootHelp();
|
|
84
86
|
return;
|
package/lib/main.js
CHANGED
|
@@ -70,6 +70,11 @@ async function run(argv = process.argv.slice(2), options) {
|
|
|
70
70
|
argvSlice = argv;
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
+
// If the the default command is '.' (signifying that the CLI is a single command CLI) and '.' is provided
|
|
74
|
+
// as an argument, we need to add back the '.' to argv since it was stripped out earlier as part of the
|
|
75
|
+
// command id.
|
|
76
|
+
if (config.pjson.oclif.default === '.' && id === '.' && argv[0] === '.')
|
|
77
|
+
argvSlice = ['.', ...argvSlice];
|
|
73
78
|
await config.runCommand(id, argvSlice, cmd);
|
|
74
79
|
}
|
|
75
80
|
exports.run = run;
|