jorgebucaran / fisher

A plugin manager for Fish
https://git.io/fisher
MIT License
7.7k stars 263 forks source link

fisher update fails (in fish version 3.4.0) #706

Closed mfloryan closed 2 years ago

mfloryan commented 2 years ago

I suspect this might be related to recent upgrade of fish shell to 3.4.0

When running fisher update it fails with the following errors:

fisher update version 4.3.1
Fetching https://codeload.github.com/IlanCosman/tide/tar.gz/v5
Fetching https://codeload.github.com/jorgebucaran/fisher/tar.gz/HEAD
test: Missing argument at index 3
! -e
     ^
~/.config/fish/functions/fisher.fish (line 109):
                if set --local source $source_plugins[(contains --index -- "$plugin" $fetch_plugins)] && test ! -e $source
                                                                                                         ^
in function 'fisher' with arguments 'update'
test: Missing argument at index 3
! -e
     ^
~/.config/fish/functions/fisher.fish (line 109):
                if set --local source $source_plugins[(contains --index -- "$plugin" $fetch_plugins)] && test ! -e $source
                                                                                                         ^
in function 'fisher' with arguments 'update'
string replace: Expected at least 2 args, got 1
Installing jorgebucaran/fisher
string replace: Expected at least 2 args, got 1
Installing IlanCosman/tide@v5
Updated 2 plugin/s
jorgebucaran commented 2 years ago

@mfloryan I'm running 3.4.0 and can't reproduce this issue. What is your OS? How did you install Fisher?

It seems that when test ! -e $source is evaluated https://github.com/jorgebucaran/fisher/blob/93dafd242b52a0dc6bea54130d0ea041830c7fd6/functions/fisher.fish#L109 $source is empty, causing a missing argument error. But how can $source be empty if we had just appended a random directory for each plugin in $fetch_plugins https://github.com/jorgebucaran/fisher/blob/93dafd242b52a0dc6bea54130d0ea041830c7fd6/functions/fisher.fish#L75-L77

Can you check if your mktemp -d works as expected? If it prints nothing, that could explain the missing argument error.

Also, could you directly edit Fisher's source code and add some logs to help me debug it in your machine? I'd like to see both $fetch_plugins and $source_plugins logged to the console in line 107:

printf "%s\n" $fetch_plugins
printf "%s\n" $source_plugins
mfloryan commented 2 years ago

I can no longer recreate the problem now. Thanks for looking into it, will re-open if this appears again.