Skip to content

Commit 63c1818

Browse files
authored
Change fish_plugins to use ~ instead of $HOME for better portability (#792)
The fish_plugins file previously used absolute `$HOME` paths, making it non-portable across different machines. This change updates the file to use the ~ character for the home directory, improving compatibility and portability by avoiding hard-coded paths.
1 parent 2efd33c commit 63c1818

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: functions/fisher.fish

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function fisher --argument-names cmd --description "A plugin manager for Fish"
2929
set --local old_plugins $_fisher_plugins
3030
set --local new_plugins
3131

32-
test -e $fish_plugins && set --local file_plugins (string match --regex -- '^[^\s]+$' <$fish_plugins)
32+
test -e $fish_plugins && set --local file_plugins (string match --regex -- '^[^\s]+$' <$fish_plugins | string replace -- \~ ~)
3333

3434
if ! set --query argv[2]
3535
if test "$cmd" != update
@@ -206,7 +206,7 @@ function fisher --argument-names cmd --description "A plugin manager for Fish"
206206
contains -- (string lower -- $plugin) (string lower -- $commit_plugins) || set --append commit_plugins $plugin
207207
end
208208

209-
printf "%s\n" $commit_plugins >$fish_plugins
209+
string replace --regex -- $HOME \~ $commit_plugins >$fish_plugins
210210
else
211211
set --erase _fisher_plugins
212212
command rm -f $fish_plugins

0 commit comments

Comments
 (0)