Skip to content

Commit

Permalink
Change fish_plugins to use ~ instead of $HOME for better portability (
Browse files Browse the repository at this point in the history
#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.
  • Loading branch information
mattmc3 authored Sep 10, 2024
1 parent 2efd33c commit 63c1818
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions functions/fisher.fish
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function fisher --argument-names cmd --description "A plugin manager for Fish"
set --local old_plugins $_fisher_plugins
set --local new_plugins

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

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

printf "%s\n" $commit_plugins >$fish_plugins
string replace --regex -- $HOME \~ $commit_plugins >$fish_plugins
else
set --erase _fisher_plugins
command rm -f $fish_plugins
Expand Down

0 comments on commit 63c1818

Please sign in to comment.