Skip to content

Commit

Permalink
fix: command id parsing bug in oclif
Browse files Browse the repository at this point in the history
patch for PR oclif/core#886
  • Loading branch information
Roy Razon committed Nov 27, 2023
1 parent e4ed7c3 commit 5455c2e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
"dist/hooks/**/*.js"
]
},
"bundleDependencies": ["@oclif/core"],
"scripts": {
"build": "yarn clean && tsc -b",
"clean": "shx rm -rf dist",
Expand All @@ -103,8 +104,7 @@
"posttest": "yarn lint",
"prepack": "yarn build && oclif manifest && oclif readme --dir docs --multi && ./scripts/prepare_and_copy_docs.sh",
"cli": "./bin/dev",
"version": "oclif readme && git add README.md",
"bump-to": "yarn version --no-commit-hooks --no-git-tag-version --new-version"
"version": "oclif readme && git add README.md"
},
"engines": {
"node": ">=18.0.0"
Expand Down
13 changes: 13 additions & 0 deletions patches/@oclif+core+3.12.0.patch
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
diff --git a/node_modules/@oclif/core/lib/help/util.js b/node_modules/@oclif/core/lib/help/util.js
index 6c97a31..3a7ace6 100644
--- a/node_modules/@oclif/core/lib/help/util.js
+++ b/node_modules/@oclif/core/lib/help/util.js
@@ -43,7 +43,7 @@ function collateSpacedCmdIDFromArgs(argv, config) {
const ids = (0, util_1.collectUsableIds)(config.commandIDs);
const final = [];
const idPresent = (id) => ids.has(id);
- const finalizeId = (s) => (s ? [...final, s].join(':') : final.join(':'));
+ const finalizeId = (s) => (s ? [...final, s] : final).filter(Boolean).join(':');
const hasArgs = () => {
const id = finalizeId();
if (!id)
diff --git a/node_modules/@oclif/core/lib/interfaces/parser.d.ts b/node_modules/@oclif/core/lib/interfaces/parser.d.ts
index acb8583..2d53745 100644
--- a/node_modules/@oclif/core/lib/interfaces/parser.d.ts
Expand Down

0 comments on commit 5455c2e

Please sign in to comment.