File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed
Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @bomb.sh/tab ' : patch
3+ ---
4+
5+ fix: use npx for portable completion scripts instead of absolute paths
Original file line number Diff line number Diff 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-
8274function 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
You can’t perform that action at this time.
0 commit comments