refactor: prefer using .cache directory

This commit is contained in:
Wenxuan Zhang 2020-09-11 17:11:58 +08:00
parent 56ece45973
commit 6c6e493b94
2 changed files with 5 additions and 5 deletions

View file

@ -228,9 +228,9 @@ end
if test -z "$FORGIT_GI_REPO_LOCAL"
if test "XDG_CACHE_HOME"
set -x FORGIT_GI_REPO_LOCAL $XDG_CACHE_HOME/.forgit/gi/repos/dvcs/gitignore
set -x FORGIT_GI_REPO_LOCAL $XDG_CACHE_HOME/forgit/gi/repos/dvcs/gitignore
else
set -x FORGIT_GI_REPO_LOCAL ~/.forgit/gi/repos/dvcs/gitignore
set -x FORGIT_GI_REPO_LOCAL $HOME/.cache/forgit/gi/repos/dvcs/gitignore
end
end
@ -268,7 +268,7 @@ function forgit::ignore
end
if type -q bat > /dev/null 2>&1
forgit::ignore::get $args | $FORGIT_IGNORE_PAGER
forgit::ignore::get $args | $FORGIT_IGNORE_PAGER
else
forgit::ignore::get $args
end
@ -370,7 +370,7 @@ if test -z "$FORGIT_NO_ALIASES"
else
alias gss 'forgit::stash::show'
end
if test -n "$forgit_cherry_pick"
alias $forgit_cherry_pick 'forgit::cherry::pick'
else

View file

@ -165,7 +165,7 @@ forgit::cherry::pick() {
# git ignore generator
export FORGIT_GI_REPO_REMOTE=${FORGIT_GI_REPO_REMOTE:-https://github.com/dvcs/gitignore}
export FORGIT_GI_REPO_LOCAL="${FORGIT_GI_REPO_LOCAL:-${XDG_CACHE_HOME:-$HOME}/.forgit/gi/repos/dvcs/gitignore}"
export FORGIT_GI_REPO_LOCAL="${FORGIT_GI_REPO_LOCAL:-${XDG_CACHE_HOME:-$HOME/.cache}/forgit/gi/repos/dvcs/gitignore}"
export FORGIT_GI_TEMPLATES=${FORGIT_GI_TEMPLATES:-$FORGIT_GI_REPO_LOCAL/templates}
forgit::ignore() {