addet GIT variable to fetch git repo path
This commit is contained in:
parent
556e6b2f50
commit
e5af225060
1 changed files with 21 additions and 0 deletions
21
.zshenv
21
.zshenv
|
@ -72,6 +72,27 @@ fi
|
||||||
[ -d "$HOME/.zsh/plugins/fzf-zsh-plugin/bin" ] &&
|
[ -d "$HOME/.zsh/plugins/fzf-zsh-plugin/bin" ] &&
|
||||||
export PATH="$HOME/.zsh/plugins/fzf-zsh-plugin/bin:$PATH"
|
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 │
|
# │ proxy config │
|
||||||
# ╰──────────────╯
|
# ╰──────────────╯
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue