Fisher: Fisher installing to current directory instead of my functions directory

Created on 29 Nov 2019  ยท  16Comments  ยท  Source: jorgebucaran/fisher

I fisher installed b4b4r07/enhancd and pretty quickly decided I didn't like it, so I uninstalled it. And now, my fisher install path seems to be broken and I can't work out why.

 ~ ๎‚ฑ TEMP ๎‚ฐ ls -la
 ~ ๎‚ฑ TEMP ๎‚ฐ fisher
To completely erase z's data, remove:
/Users/andy/.local/share/z/data
fetching https://codeload.github.com/franciscolourenco/done/tar.gz/master
fetching https://codeload.github.com/drcongo/agnoster/tar.gz/master
fetching https://codeload.github.com/edc/bass/tar.gz/master
fetching https://codeload.github.com/jethrokuan/z/tar.gz/master
fetching https://codeload.github.com/patrickf3139/Colored-Man-Pages/tar.gz/master
linking done.fish
linking agnoster.fish
linking fish_mode_prompt.fish
linking fish_prompt.fish
linking __bass.py
linking bass.fish
linking __z.fish
linking __z_add.fish
linking __z_clean.fish
linking __z_complete.fish
linking uninstall.fish
linking z.fish
linking man.fish
fetching https://codeload.github.com/fishpkg/fish-humanize-duration/tar.gz/master
linking humanize_duration.fish
added 6 packages, removed 6 packages in 2.25s
 ~ ๎‚ฑ TEMP ๎‚ฐ ls -la
.rw-r--r--  andy  staff  2.9 KB  Fri Nov 29 13:11:32 2019  ๎˜†  __bass.py
.rw-r--r--  andy  staff  5.9 KB  Fri Nov 29 13:11:32 2019  ๏’‰  __z.fish
.rw-r--r--  andy  staff  1.2 KB  Fri Nov 29 13:11:32 2019  ๏’‰  __z_add.fish
.rw-r--r--  andy  staff  333 B   Fri Nov 29 13:11:32 2019  ๏’‰  __z_clean.fish
.rw-r--r--  andy  staff  627 B   Fri Nov 29 13:11:32 2019  ๏’‰  __z_complete.fish
.rw-r--r--  andy  staff  1.1 KB  Fri Nov 29 13:11:32 2019  ๏’‰  agnoster.fish
.rw-r--r--  andy  staff  506 B   Fri Nov 29 13:11:32 2019  ๏’‰  bass.fish
.rw-r--r--  andy  staff    5 KB  Fri Nov 29 13:11:32 2019  ๏’‰  done.fish
.rw-r--r--  andy  staff  355 B   Fri Nov 29 13:11:32 2019  ๏’‰  fish_mode_prompt.fish
.rw-r--r--  andy  staff  3.7 KB  Fri Nov 29 13:11:32 2019  ๏’‰  fish_prompt.fish
.rw-r--r--  andy  staff  597 B   Fri Nov 29 13:11:33 2019  ๏’‰  humanize_duration.fish
.rw-r--r--  andy  staff  975 B   Fri Nov 29 13:11:33 2019  ๏’‰  man.fish
.rw-r--r--  andy  staff  270 B   Fri Nov 29 13:11:32 2019  ๏’‰  uninstall.fish
.rw-r--r--  andy  staff  706 B   Fri Nov 29 13:11:32 2019  ๏’‰  z.fish

You can see it's installed everything in the current working directory, but it also removed all the functions that were previously installed in my fish/functions/ directory. My $fisher_path is empty and my $fish_function_path is correctly set. I've tried removing fisher and reinstalling but it's still happening.

I can work around this for now by remembering to cd $fish_function_path[1] before running any fisher commands, but I'd love to know why it's doing this for long term sanity.

All 16 comments

@drcongo It could be errors in your path variables, maybe there's an extra / somewhere, but I'm just throwing darts in the dark. It's really hard to tell what the problem is with just this info at the moment. Fisher always writes to your ~/.config/fish/functions directory by default.

Let me think about it. If you have anything else to share that might help, please do.

Thanks for the tip, I suspect you're right. My $fish_complete_path starts with /Users/andy/.config//fish/completions but I can't for the life of me work out where that's getting set. I'll dig around, or just override it if I can't find it.

I just installed/uninstalled enhancd and am suffering the same issue, with the same // in $fish_complete_path: /home/insipx/.config/fish//completions

@insipx Maybe you set your XDG_CONFIG_HOME and XDG_CACHE_HOME incorrectly.

I am having the same issue, env vars are:

XDG_CACHE_HOME /home/stavros/.cache/
XDG_CONFIG_DIRS /etc/xdg/xdg-xubuntu:/etc/xdg:/etc/xdg
XDG_CONFIG_HOME /home/stavros/.config/

@insipx I have the same issue, mine is because I have a trailing slash in my XDG_CACHE_HOME in my .profile. I don't know if this causes fisher to fail, but I have the same config as you.

I changed the variable and that was, indeed, the issue. It looks like fisher gets confused by double slashes in the path and misbehaves. It should probably be fixed, as /home/stavros//whatever is a valid path in fish, but it wouldn't hurt to change your env var to in case anything else chokes.

@skorokithakis It must be it. We had the same issue some time ago. I think we could sanitize paths to prevent this from happening -- I'll investigate.

@drcongo @insipx Can you verify if the issue was a wrong path in any of your XDG_* vars?

@skorokithakis I'd like to work on this now, but I'm not sure where to begin exactly. Is the problem only a trailing slash, repeated slash or both? What would be a path that breaks fisher? Thanks.

@jorgebucaran for me, the problem was that my config path was set to /home/stavros/.config/. If you replace your username and set that as your path, you should be able to reproduce.

Trying to do some cleanup around here. Was this issue fixed for everyone? @drcongo @insipx @skorokithakis

I fixed it by fixing my env var, so yes and no.

Trying to do some cleanup around here. Was this issue fixed for everyone? @drcongo @insipx @skorokithakis

Works for me! I also fixed it by changing the env var

I've not run into it again since as I don't really mess with my Fish setup very often. Happy to go with the answers above.

The issue was probably something to do with incorrectly set env variables, see: https://github.com/jorgebucaran/fisher/issues/559#issuecomment-596461834

For now avoid path variables with a trailing slash (remove the trailing slash). ๐Ÿ™

@jorgebucaran it definitely was, but fisher should tolerate the trailing slash anyway without crashing.

Was this page helpful?
0 / 5 - 0 ratings