[+] git-id

This commit is contained in:
Hykilpikonna
2022-11-24 15:07:30 -05:00
parent 1c08ef474c
commit fa7b51b86a
2 changed files with 43 additions and 20 deletions
+20
View File
@@ -211,6 +211,26 @@ setproxy() {
prompt-update
}
# Git identity
git-id() {
export GIT_USER="$1"
export GIT_EMAIL="$2"
git-id-prompt
}
git-id-prompt() {
if [[ -z "$GIT_USER" ]] && [[ -z "$GIT_EMAIL" ]]; then
prompt-reset
else
prompt-set 30 "&cGit ID: $GIT_USER | $GIT_EMAIL "
prompt-update
fi
}
git-id-prompt
export GIT_BIN=$(which git)
git() {
[[ -z "$GIT_USER" ]] && $GIT_BIN "$@" || $GIT_BIN -c "user.name=$GIT_USER" -c "user.email=$GIT_EMAIL" "$@"
}
# Mac hostname
mac-hostname() {
name="$@"