-
Notifications
You must be signed in to change notification settings - Fork 788
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix!: align Fish entrypoint behaviour with other shells (#1524)
- Loading branch information
1 parent
b6d0ca2
commit 8919f40
Showing
7 changed files
with
61 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,6 @@ insert_final_newline = true | |
|
||
[*.py] | ||
indent_size = 4 | ||
|
||
[*.fish] | ||
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,24 @@ | ||
if not set -q ASDF_DIR | ||
set -x ASDF_DIR (dirname (status -f)) | ||
if test -z $ASDF_DIR | ||
set ASDF_DIR (realpath (dirname (status filename))) | ||
end | ||
set --export ASDF_DIR $ASDF_DIR | ||
|
||
# Add asdf to PATH | ||
# fish_add_path was added in fish 3.2, so we need a fallback for older version | ||
if type -q fish_add_path | ||
if test -n "$ASDF_DATA_DIR" | ||
fish_add_path --global --move "$ASDF_DATA_DIR/shims" "$ASDF_DIR/bin" | ||
else | ||
fish_add_path --global --move "$HOME/.asdf/shims" "$ASDF_DIR/bin" | ||
end | ||
set -l _asdf_bin "$ASDF_DIR/bin" | ||
if test -z $ASDF_DATA_DIR | ||
set _asdf_shims "$HOME/.asdf/shims" | ||
else | ||
set -l asdf_user_shims ( | ||
if test -n "$ASDF_DATA_DIR" | ||
printf "%s\n" "$ASDF_DATA_DIR/shims" | ||
else | ||
printf "%s\n" "$HOME/.asdf/shims" | ||
end | ||
) | ||
|
||
set -l asdf_bin_dirs $ASDF_DIR/bin $asdf_user_shims | ||
set _asdf_shims "$ASDF_DATA_DIR/shims" | ||
end | ||
|
||
for x in $asdf_bin_dirs | ||
if test -d $x | ||
for i in (seq 1 (count $PATH)) | ||
if test $PATH[$i] = $x | ||
set -e PATH[$i] | ||
break | ||
end | ||
end | ||
end | ||
set PATH $x $PATH | ||
end | ||
# Do not use fish_add_path (added in Fish 3.2) because it | ||
# potentially changes the order of items in fish_user_paths | ||
if not contains $_asdf_bin $fish_user_paths | ||
set --global --prepend fish_user_paths $_asdf_bin | ||
end | ||
if not contains $_asdf_shims $fish_user_paths | ||
set --global --prepend fish_user_paths $_asdf_shims | ||
end | ||
set --erase _asdf_bin _asdf_shims | ||
|
||
# Load the asdf wrapper function | ||
. $ASDF_DIR/lib/asdf.fish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
|
||
# Add function wrapper so we can export variables | ||
# The asdf function is a wrapper so we can export variables | ||
function asdf | ||
set command $argv[1] | ||
set -e argv[1] | ||
|
||
switch "$command" | ||
case "shell" | ||
# source commands that need to export variables | ||
case shell | ||
# Source commands that need to export variables. | ||
command asdf export-shell-version fish $argv | source # asdf_allow: source | ||
case '*' | ||
# forward other commands to asdf script | ||
# Forward other commands to asdf script. | ||
command asdf "$command" $argv | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters