From 847ec73751ced9d149ce0826309fee0f894ca664 Mon Sep 17 00:00:00 2001 From: Max Nordlund Date: Thu, 7 Oct 2021 15:20:41 +0200 Subject: [PATCH] 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 --- lib/asdf.fish | 2 +- test/banned_commands.bats | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/asdf.fish b/lib/asdf.fish index 698b5444f..d14ab3897 100644 --- a/lib/asdf.fish +++ b/lib/asdf.fish @@ -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 diff --git a/test/banned_commands.bats b/test/banned_commands.bats index 40d5e0e6c..1202f1419 100644 --- a/test/banned_commands.bats +++ b/test/banned_commands.bats @@ -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 )