@oclif/core
Advanced tools
Comparing version 1.9.0 to 1.9.1
@@ -5,2 +5,9 @@ # Changelog | ||
### [1.9.1](https://github.com/oclif/core/compare/v1.9.0...v1.9.1) (2022-06-14) | ||
### Bug Fixes | ||
* support CLIs with single top level command ([#426](https://github.com/oclif/core/issues/426)) ([44adb4d](https://github.com/oclif/core/commit/44adb4d387695548a017b38249b0bc3453aedbdf)) | ||
## [1.9.0](https://github.com/oclif/core/compare/v1.8.2...v1.9.0) (2022-05-20) | ||
@@ -7,0 +14,0 @@ |
@@ -162,3 +162,4 @@ "use strict"; | ||
const command = p.name !== 'index' && p.name; | ||
return [...topics, command].filter(f => f).join(':'); | ||
const id = [...topics, command].filter(f => f).join(':'); | ||
return id === '' ? '.' : id; | ||
}); | ||
@@ -165,0 +166,0 @@ this._debug('found commands', ids); |
@@ -80,4 +80,6 @@ "use strict"; | ||
const rootCmd = this.config.findCommand(this.config.pjson.oclif.default); | ||
if (rootCmd) | ||
if (rootCmd) { | ||
await this.showCommandHelp(rootCmd); | ||
return; | ||
} | ||
} | ||
@@ -84,0 +86,0 @@ await this.showRootHelp(); |
@@ -73,4 +73,9 @@ "use strict"; | ||
} | ||
// If the the default command is '.' (signifying that the CLI is a single command CLI) and '.' is provided | ||
// as an argument, we need to add back the '.' to argv since it was stripped out earlier as part of the | ||
// command id. | ||
if (config.pjson.oclif.default === '.' && id === '.' && argv[0] === '.') | ||
argvSlice = ['.', ...argvSlice]; | ||
await config.runCommand(id, argvSlice, cmd); | ||
} | ||
exports.run = run; |
{ | ||
"name": "@oclif/core", | ||
"description": "base library for oclif CLIs", | ||
"version": "1.9.0", | ||
"version": "1.9.1", | ||
"author": "Salesforce", | ||
@@ -6,0 +6,0 @@ "bugs": "https://github.com/oclif/core/issues", |
305611
7642