Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/crazy-beds-rhyme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@bomb.sh/tab': patch
---

fix: use npx for portable completion scripts instead of absolute paths
13 changes: 3 additions & 10 deletions bin/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,11 @@ async function main() {
cli.parse();
}

// function generateCompletionScript(packageManager: string, shell: string) {
// const name = packageManager;
// const executable = process.env.npm_execpath
// ? `${packageManager} exec @bomb.sh/tab ${packageManager}`
// : `node ${process.argv[1]} ${packageManager}`;
// script(shell as any, name, executable);
// }

function generateCompletionScript(packageManager: string, shell: string) {
const name = packageManager;
// this always points at the actual file on disk (TESTING)
const executable = `node ${process.argv[1]} ${packageManager}`;
const executable = process.env.npm_config_user_agent
? `npx --yes @bomb.sh/tab ${packageManager}`
: `node ${process.argv[1]} ${packageManager}`;
script(shell as any, name, executable);
}

Expand Down
Loading