Hey. When I try to install Fisher, using curl -sL git.io/fisher | source && fisher install jorgebucaran/fisher command, I get the following:
fisher install version 4.1.0
fetching https://codeload.github.com/jorgebucaran/fisher/tar.gz/HEAD
usage: mkdir [-pv] [-m mode] directory ...
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file target_file
cp [-R [-H | -L | -P]] [-fi | -n] [-apvXc] source_file ... target_directory
installing jorgebucaran/fisher
/var/folders/c1/3s14wgzj4z3dmxvtk9c9ldn80000gn/T/tmp.kiqrSXC5/functions/fisher.fish/completions/fisher.fish
source: Error encountered while sourcing file '/var/folders/c1/3s14wgzj4z3dmxvtk9c9ldn80000gn/T/tmp.kiqrSXC5/functions/fisher.fish/completions/fisher.fish':
source: Not a directory
installed 1 plugin/s
It's caused because I tried to reinstall Fisher (by removing it and installing it again), but I can't install it. I think there are some leftovers, but I'm not sure where to find them.
I'm on macOS High Sierra 10.13.6.
@x7a I need as much info as you can give me. What did you do exactly? Do you remember? What was your motivation to do it?
Did you run curl -sL git.io/fisher | source && fisher install... from Fish or from a different shell? Are you using the latest Fish? Do you have a Fish directory? Is your Fish directory a symlink or any directories under it?
What's in your environment? Run set.
Try to install it again from a different shell session. What happens now?
@jorgebucaran thanks for your effort.
I've fixed it! The problem was in my config.fish. I have a fish script dedicated to set XDG specification variables and other aliases required to move most of my dotfiles to .config, .cache and .local/share. And so I set my $fisher_path to $XDG_DATA_HOME/fisher (set -gx fisher_path $XDG_DATA_HOME/fisher) before actually sourcing that Fish script.
@x7a Glad to know! Could you share (sans any personal information) the script where you set those variables? I still believe Fisher shouldn't have failed this way.
@jorgebucaran sure.
#! /bin/sh
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_CONFIG_HOME="$HOME/.config"
export Z_DATA="$XDG_DATA_HOME/z"
export IPYTHONDIR="$XDG_CONFIG_HOME"/jupyter
export JUPYTER_CONFIG_DIR="$XDG_CONFIG_HOME"/jupyter
export NVM_DIR="$XDG_DATA_HOME"/nvm
export GEM_HOME="$XDG_DATA_HOME"/gem
export GEM_SPEC_CACHE="$XDG_CACHE_HOME"/gem
export LESSHISTFILE=-
export WGETRC="$XDG_CONFIG_HOME/wget/wgetrc"
alias wget="wget --hsts-file=\"$XDG_CACHE_HOME/wget/wget-hsts\""
export XAUTHORITY="$XDG_DATA_HOME/x/Xauthority"
alias svn="svn --config-dir \"$XDG_CONFIG_HOME/subversion\""
export GEM_HOME="$XDG_DATA_HOME/gem"
export GEM_SPEC_CACHE="$XDG_CACHE_HOME/gem"
export NODE_REPL_HISTORY="$XDG_DATA_HOME"/node_repl_history
export PYENV_ROOT="$XDG_CONFIG_HOME/pyenv"
# export NPM_CONFIG_USERCONFIG=$XDG_CONFIG_HOME/npm/npmrc
alias yarn="yarn --use-yarnrc $XDG_CONFIG_HOME/yarn/config"
@x7a You had a #! /bin/sh in your config.fish? That doesn't look correct.
@jorgebucaran I have it in most of my Fish scripts. But I was wondering if #! /usr/bin/env fish wouldn't be a better idea. Anyways, I don't think that was the key problem as I saw #! /bin/sh in many other Fish configurations. The key problem was that I set $fisher_path to $XDG_DATA_HOME/fisher before the $XDG_DATA_HOME was actually set. So in the end my $fisher_path variable was empty.
I might be able to improve Fisher with this new knowledge. Like checking if $fisher_path exists before attempting to
Thanks again! 🙌
@jorgebucaran no problem. And one more question. Do you think #! /usr/bin/env fish is a better practise?
@x7a You don't need that line in your config.fish at all! So, feel free to remove it.
I also suggest replacing export with set -gx and _not_ using alias. Instead, you can create a function or an abbreviation.