@salesforce/cli 1.37.0 → 1.38.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/CHANGELOG.md CHANGED
@@ -2,7 +2,11 @@
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.37.0](https://github.com/salesforcecli/cli/compare/v1.36.0...v1.37.0) (2022-07-13)
5
+ ## [1.38.0](https://github.com/salesforcecli/cli/compare/v1.36.0...v1.38.0) (2022-07-20)
6
+
7
+ ### Features
8
+
9
+ - run command match when only one exists ([ab519b8](https://github.com/salesforcecli/cli/commit/ab519b8a7739db232fbb8709e31ae274038bd5c8))
6
10
 
7
11
  ### Bug Fixes
8
12
 
package/README.md CHANGED
@@ -31,7 +31,7 @@ $ npm install -g @salesforce/cli
31
31
  $ sf COMMAND
32
32
  running command...
33
33
  $ sf (--version|-v)
34
- @salesforce/cli/1.37.0 linux-x64 node-v14.20.0
34
+ @salesforce/cli/1.38.0 linux-x64 node-v14.20.0
35
35
  $ sf --help [COMMAND]
36
36
  USAGE
37
37
  $ sf COMMAND
@@ -8,7 +8,9 @@
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  const core_1 = require("@oclif/core");
10
10
  const sf_plugins_core_1 = require("@salesforce/sf-plugins-core");
11
- const hook = async function ({ config, matches, argv }) {
11
+ async function determineCommand(config, matches) {
12
+ if (matches.length === 1)
13
+ return matches[0].id;
12
14
  const prompter = new sf_plugins_core_1.Prompter();
13
15
  const { command } = await prompter.timedPrompt([
14
16
  {
@@ -18,6 +20,10 @@ const hook = async function ({ config, matches, argv }) {
18
20
  choices: matches.map((p) => (0, core_1.toConfiguredId)(p.id, config)),
19
21
  },
20
22
  ]);
23
+ return command;
24
+ }
25
+ const hook = async function ({ config, matches, argv }) {
26
+ const command = await determineCommand(config, matches);
21
27
  if (argv.includes('--help') || argv.includes('-h')) {
22
28
  return config.runCommand('help', [(0, core_1.toStandardizedId)(command, config)]);
23
29
  }