1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-02-07 13:41:21 +00:00

Actually cache the experimental mode stuff

Spenser Truex 2021-01-25 15:45:04 +00:00
parent 34f7db6b18
commit 954587da2b

@ -25,10 +25,13 @@ Doing this with `--enable-experimental-instant-mode` requires some care, because
This is a zsh script. To check for the login shell in bash, use `shopt -q login_shell` instead of setopt.
```zsh
#!/bin/zsh
thefuck_experimental_cache="$XDG_RUNTIME_DIR"/thefuck_experimental_cache
THEFUCK_EXPERIMENTAL_LOCK_KLUDGE="$XDG_RUNTIME_DIR"/thefuck_experimental_lock_kludge
experimentallyinstantlylockkludginglyverylongname () {
printf %s " $$ " >>"$THEFUCK_EXPERIMENTAL_LOCK_KLUDGE"
eval "$(thefuck --enable-experimental-instant-mode --alias noop)"
[[ ! -f "$thefuck_experimental_cache" ]] \
&& thefuck --enable-experimental-instant-mode --alias noop >"$thefuck_experimental_cache" \
&& source "$thefuck_experimental_cache"
}
[[ ! -e "$THEFUCK_EXPERIMENTAL_LOCK_KLUDGE" ]] \
@ -43,3 +46,5 @@ else
rm "$THEFUCK_EXPERIMENTAL_LOCK_KLUDGE"
fi
```
```