addet GIT variable to fetch git repo path

This commit is contained in:
pika 2025-03-27 12:54:43 +01:00
parent 556e6b2f50
commit e5af225060

21
.zshenv
View file

@ -72,6 +72,27 @@ fi
[ -d "$HOME/.zsh/plugins/fzf-zsh-plugin/bin" ] &&
export PATH="$HOME/.zsh/plugins/fzf-zsh-plugin/bin:$PATH"
# ──────────────────────────────────────< git config >──────────────────────────────────────
getGitDir() {
if [[ -d "$HOME/Dokumente/git/forgejo" ]]; then
export GIT="$HOME/Dokumente/git/forgejo"
return 0
elif [[ -d "$HOME/git" ]]; then
[ -d "$HOME/git/forgejo" ] &&
export GIT="$HOME/git/forgejo" &&
return 0
export GIT="$HOME/git"
return 0
fi
}
if command_exists git; then
[ -z "$GIT" ] &&
getGitDir
fi
# ╭──────────────╮
# │ proxy config │
# ╰──────────────╯