Skip to content

Commit

Permalink
fix: Use more idiomatic fish (#1042)
Browse files Browse the repository at this point in the history
The use of `.` is deprecated in fish, unlike POSIX shells. We can avoid
calling `psub` and pipe directly into source which does the same thing.

https://fishshell.com/docs/current/cmds/source.html
  • Loading branch information
maxnordlund committed Oct 7, 2021
1 parent 8a515f4 commit 847ec73
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/asdf.fish
Expand Up @@ -7,7 +7,7 @@ function asdf
switch "$command"
case "shell"
# source commands that need to export variables
. (asdf export-shell-version fish $argv | psub)
command asdf export-shell-version fish $argv | source # asdf_allow: source
case '*'
# forward other commands to asdf script
command asdf "$command" $argv
Expand Down
1 change: 1 addition & 0 deletions test/banned_commands.bats
Expand Up @@ -26,6 +26,7 @@ banned_commands=(
"sort.*-V"
"sort.*--sort-versions"
# source isn't POSIX compliant. . behaves the same and is POSIX compliant
# Except in fish, where . is deprecated, and will be removed in the future.
source
)

Expand Down

0 comments on commit 847ec73

Please sign in to comment.