fix: Use more idiomatic fish (#1042)

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
This commit is contained in:
Max Nordlund 2021-10-07 15:20:41 +02:00 committed by GitHub
parent 8a515f49d7
commit 847ec73751
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -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

View File

@ -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
)