Skip to content

Commit 111887b

Browse files
committed
fix: use npx for portable completion scripts
1 parent 0a377c6 commit 111887b

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

.changeset/crazy-beds-rhyme.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@bomb.sh/tab': patch
3+
---
4+
5+
fix: use npx for portable completion scripts instead of absolute paths

bin/cli.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,18 +71,11 @@ async function main() {
7171
cli.parse();
7272
}
7373

74-
// function generateCompletionScript(packageManager: string, shell: string) {
75-
// const name = packageManager;
76-
// const executable = process.env.npm_execpath
77-
// ? `${packageManager} exec @bomb.sh/tab ${packageManager}`
78-
// : `node ${process.argv[1]} ${packageManager}`;
79-
// script(shell as any, name, executable);
80-
// }
81-
8274
function generateCompletionScript(packageManager: string, shell: string) {
8375
const name = packageManager;
84-
// this always points at the actual file on disk (TESTING)
85-
const executable = `node ${process.argv[1]} ${packageManager}`;
76+
const executable = process.env.npm_execpath
77+
? `npx --yes @bomb.sh/tab ${packageManager}`
78+
: `node ${process.argv[1]} ${packageManager}`;
8679
script(shell as any, name, executable);
8780
}
8881

0 commit comments

Comments
 (0)