Skip to content

Commit

Permalink
fix(dump): update fish command-not-found (pkgxdev#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
branchvincent authored Nov 20, 2022
1 parent 50183c5 commit fa9ddb7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/app.dump.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,13 @@ export default async function dump(args: Args) {
break
case 'fish':
rv = undent`
function command_not_found_handler
switch "$argv[0]"`
function fish_command_not_found
switch "$argv[1]"\n\n`;
for (const uninstalled of pending) {
const exes = await pantry.getProvides(uninstalled)
if (exes.length) {
const cmds = exes.join(" ")
rv += ` case ${cmds}; tea '+${pkg.str(uninstalled)}' "$argv"\n`
rv += ` case ${cmds}; tea '+${pkg.str(uninstalled)}' $argv\n`
}
}
rv += " end\nend"
Expand All @@ -193,7 +193,7 @@ export default async function dump(args: Args) {
await print("if typeset -f command_not_found_handle >/dev/null; then unset -f command_not_found_handle; fi")
break
case 'fish':
await print("if functions --query command_not_found_handler >/dev/null; functions --erase command_not_found_handler; end")
await print("if functions --query fish_command_not_found; functions --erase fish_command_not_found; end")
break
}
}
Expand Down

0 comments on commit fa9ddb7

Please sign in to comment.