Browse Source

fix(plugins): cache thefuck aliases (#5522)

Francesco Giannelli 2 years ago
parent
commit
a2e6a85bf3
1 changed files with 2 additions and 1 deletions
  1. 2 1
      plugins/thefuck/thefuck.plugin.zsh

+ 2 - 1
plugins/thefuck/thefuck.plugin.zsh

@@ -5,7 +5,8 @@ if [[ -z $commands[thefuck] ]]; then
 fi
 
 # Register alias
-eval "$(thefuck --alias)"
+[[ ! -a $ZSH_CACHE_DIR/thefuck ]] && thefuck --alias > $ZSH_CACHE_DIR/thefuck
+source $ZSH_CACHE_DIR/thefuck
 
 fuck-command-line() {
     local FUCK="$(THEFUCK_REQUIRE_CONFIRMATION=0 thefuck $(fc -ln -1 | tail -n 1) 2> /dev/null)"