Closed jimvandervoort closed 1 year ago
Could it be that in one of the lines command cp -Rf $plugin/* $source $plugin is empty thus fisher tries to copy the entire root directory to $source?
If the issue is reproducible, then we can investigate further, but if not, adding a check to abort when an undefined variable is referenced should help prevent similar errors in the future. How does that sound?
Yes apologies for not adding better steps to reproduce @jorgebucaran, will see if I can manage to make this reproducible when I have time later this week.
Would you mind sharing your config.fish here? I'm thinking there might be something in there that's causing a hiccup with Fisher. Honestly, I doubt it's a Fisher issue or something we can fix on our side, but let's take a look anyway!
Sure!
# set -x LANG "en_GB.UTF-8"
# Set abbreviations if not set
if not set -q abbrs_initialized
echo -n 'Setting abbreviations... '
abbr cra 'cordova run android --device'
abbr cri 'cordova run ios --device'
abbr gpu 'git push --set-upstream origin (git rev-parse --abbrev-ref HEAD)'
abbr gp 'git push'
abbr gc 'git checkout'
abbr cpa 'cordova prepare android'
abbr ad 'adb devices'
abbr aw 'adb wait-for-usb-device'
abbr cdv cordova
abbr cpi 'cordova prepare ios'
abbr gd 'git diff'
abbr ya 'yarn add'
abbr yw 'yarn watch'
abbr mvc 'mvn clean install'
abbr hm 'history merge'
abbr gs 'git status'
abbr gst 'git stash --include-untracked'
abbr gl 'git pull'
abbr g git
abbr gi git
abbr gf 'git fatus'
abbr taco 🌮
abbr vi vim
abbr v vim
abbr port 'lsof -n -i:'
abbr mci 'mvn clean install'
abbr d 'docker'
abbr dc docker-compose
abbr ga 'git add'
abbr branch 'git rev-parse --abbrev-ref HEAD'
abbr y yarn
abbr x xargs
abbr gn 'git --no-pager'
abbr gnd 'git --no-pager diff'
abbr gco 'git checkout'
abbr gpf 'git push --force-with-lease'
abbr tf 'terraform'
abbr t 'terraform'
abbr c 'code .'
abbr ns 'kubectl ns'
abbr k kubectl
abbr e exa
abbr ye 'yarn exec'
abbr i 'idea'
abbr gap 'git add -p'
set -U abbrs_initialized
echo 'Done 👍'
end
abbr -a !! --position anywhere --function last_history_item
abbr -a @@ --position anywhere --function last_history_args
abbr -a awk1 --position anywhere "awk '{ print \$1 }'"
abbr gap 'git add -p'
abbr -a grst 'git restore --staged'
set fish_greeting
# Command aliases
alias diff 'colordiff'
alias poweroff "sudo shutdown -h now"
alias reboot "sudo shutdown -r now"
alias 🌮 'taco'
alias dnsflush 'sudo dscacheutil -flushcache; and sudo killall -HUP mDNSResponder'
alias vim nvim
alias pd prevd
alias nd nextd
alias :q exit # 🤓
alias browsh 'docker run --rm -it browsh/browsh'
alias yat 'bat -l yaml'
alias jat 'bat -l json'
alias spaazadate "date '+%Y%m%d'"
alias pr 'gh pr view --web'
# App aliases
alias studio "open -a \"Android Studio\""
alias sublime "open -a \"Sublime Text\""
alias xcode "open -a \"Xcode\""
alias appcode "open -a \"AppCode\""
alias sourcetree "open -a \"SourceTree\""
alias storm "open -a \"PhpStorm\""
# Android devices
alias galaxy 'printf 9886274b464b314b4b'
alias nexus 'printf 090bcc1c0182ddf4'
alias moto 'printf ZY223H9XCB'
# If using kitty, install the kitty term profile in the machine we ssh into
if [ "$TERM" = "xterm-kitty" ]
alias ssh "kitty +kitten ssh"
alias imgcat "kitty +kitten icat"
alias icat "kitty +kitten icat"
end
# Neovim colors
set -x NVIM_TUI_ENABLE_TRUE_COLOR 1
# Colored man pages
if status --is-interactive
set -x LESS_TERMCAP_md (printf "\e[01;31m")
set -x LESS_TERMCAP_me (printf "\e[0m")
set -x LESS_TERMCAP_se (printf "\e[0m")
set -x LESS_TERMCAP_so (printf "\e[01;44;33m")
set -x LESS_TERMCAP_ue (printf "\e[0m")
set -x LESS_TERMCAP_us (printf "\e[01;32m")
end
# vi keybindings
fish_vi_key_bindings
# Default editor
set -x EDITOR nvim
# Default user for cmorrell theme
set -x default_user jim
# Add home bin to PATH
set -x PATH ~/bin $PATH
# Go bin
set -x PATH ~/code/go/bin $PATH
# Krew
set -x PATH $PATH "$HOME/.krew/bin"
# Rust
# set -x PATH "$HOME/.cargo/bin" $PATH
# Configure homebrew in $PATH
/opt/homebrew/bin/brew shellenv | source
set -x PATH /usr/local/sbin $PATH
# Python 🐍
set -x PATH /usr/local/opt/python/libexec/bin $PATH
# Init pyenv
#if status --is-interactive
#source (pyenv init -|psub)
#source (pyenv virtualenv-init -|psub)
# source (rbenv init -|psub)
#end
set -x GOPATH ~/code/go
set -x PATH $PATH /opt/homebrew/opt/libpq/bin
# asdf version manager
# set -x ASDF_HASHICORP_OVERWRITE_ARCH amd64
source /opt/homebrew/opt/asdf/libexec/asdf.fish
# Use newer curl from homebrew (TLSv1.3 anyone?)
set -x PATH /opt/homebrew/opt/curl/bin $PATH
doctl completion fish | source
# Yarn global packages
set -x PATH "$HOME/.config/yarn/global/node_modules/.bin" $PATH
set -x GPG_TTY (tty)
set -x AWS_PAGER jq
#set -x GODEBUG asyncpreemptoff=1
set -x TERRAGRUNT_INCLUDE_EXTERNAL_DEPENDENCIES true
#set -x TERRAGRUNT_LOG_LEVEL error
set -x PATH $PATH ~/Library/Android/sdk/platform-tools
set -x PATH $PATH ~/Library/Android/Sdk/emulator
In conf.d
I have two functions that I use in my prompt later
function preexec_time --on-event "fish_preexec"
set -g _command_start_time (date +"%s")
end
function postexec_time --on-event "fish_postexec"
set -l curr_time (date +"%s")
set -g _command_run_time (math $curr_time-$_command_start_time)
end
And a bunch of stuff in ~/config/fish/functions
Can you still reproduce this if you comment out all the code?
I haven't been able to reproduce this yet, will try now.
I tried to reproduce last week too, did not figure it out. I suspect this might only happen when upgrading from 3.x
I'll remove 4.x and install 3.x and upgrade again.
Upgrade went smooth, cannot reproduce anymore @jorgebucaran . Should we close this issue?
Before I forget thanks a lot for responding here and thanks for creating such a useful public project! :)
Let's close this for now, but feel free to reopen if anything seems fishy. I'm glad to hear that you're enjoying Fisher! 😉
During upgrade from fisher 3.x I noticed fisher tried to copy Safari.app, I thought this was very strange so hit Control-C. After that I still got messages in my console about
cp
failing because of permission denied errors.(that went on for a while)
I got a bit worried that something malicious was going on, but then I typed in
jobs
and saw:Could it be that in one of the lines
command cp -Rf $plugin/* $source
$plugin
is empty thus fisher tries to copy the entire root directory to$source
?I killed the background job after this.
Does fish have an option like bash
set -u
(exit if undefined variable referenced)? I think fisher would be improved if it could use such an option.