Skip to content

Commit ecf72c9

Browse files
authored
Update zoxide to support Fish 4.1.x (#1046)
1 parent 9e82a6d commit ecf72c9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

templates/fish.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ end
1919
# A copy of fish's internal cd function. This makes it possible to use
2020
# `alias cd=z` without causing an infinite loop.
2121
if ! builtin functions --query __zoxide_cd_internal
22-
string replace --regex -- '^function cd\s' 'function __zoxide_cd_internal ' <$__fish_data_dir/functions/cd.fish | source
22+
if status list-files functions/cd.fish &>/dev/null
23+
status get-file functions/cd.fish | string replace --regex -- '^function cd\s' 'function __zoxide_cd_internal ' | source
24+
else
25+
string replace --regex -- '^function cd\s' 'function __zoxide_cd_internal ' <$__fish_data_dir/functions/cd.fish | source
26+
end
2327
end
2428

2529
# cd + custom logic based on the value of _ZO_ECHO.

0 commit comments

Comments
 (0)