[F] Fix repeated sourcing on update

This commit is contained in:
Azalea Gui
2023-02-04 18:47:42 -05:00
parent c5bea697ca
commit 2ed0dad834
3 changed files with 65 additions and 65 deletions
-16
View File
@@ -1,16 +0,0 @@
# Git commit wrapper
commit() {
msg="$@"
git commit -m "$msg"
}
commitall() {
git add .
commit "$@"
}
alias commita="commitall"
compush() {
commitall "$@"
git push
}
+63
View File
@@ -0,0 +1,63 @@
# Git commit wrapper
commit() {
msg="$@"
git commit -m "$msg"
}
commitall() {
git add .
commit "$@"
}
alias commita="commitall"
compush() {
commitall "$@"
git push
}
# Git identity
git-ida() {
# Zsh only
TMP_ARR=("${(@f)$(git-id-list get "$1")}")
git-id "${TMP_ARR[1]}" "${TMP_ARR[2]}"
}
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
[[ -z $GIT_BIN ]] && GIT_BIN=$(which git)
git() {
if [[ -z "$GIT_USER" ]]; then
$GIT_BIN "$@"
else
$GIT_BIN -c "user.name=$GIT_USER" -c "user.email=$GIT_EMAIL" -c "commit.gpgsign=false" "$@"
fi
}
# Git environment
git-env() {
git_commands=( add bisect branch checkout clone commit diff fetch grep init log merge pull push rebase reset restore show status tag )
for i in "${git_commands[@]}"
do
alias "$i"="git $i"
done
alias 'grm'='git rm'
alias 'gmv'='git mv'
}
git-unenv() {
git_commands=( add bisect branch checkout clone commit diff fetch grep init log merge pull push rebase reset restore show status tag grm gmv )
for i in "${git_commands[@]}"
do
unalias "$i"
done
}
+2 -49
View File
@@ -108,7 +108,7 @@ alias jctl="sudo journalctl"
alias ufw="sudo ufw" alias ufw="sudo ufw"
# Gradle with auto environment detection # Gradle with auto environment detection
GRADLE="$(which gradle)" [[ -z $GRADLE ]] && GRADLE="$(which gradle)"
gradle() { gradle() {
[[ -f "./gradlew" ]] && ./gradlew "$@" || $GRADLE "$@" [[ -f "./gradlew" ]] && ./gradlew "$@" || $GRADLE "$@"
} }
@@ -227,55 +227,8 @@ setproxy() {
prompt-update prompt-update
} }
# Git identity
git-ida() {
# Zsh only
TMP_ARR=("${(@f)$(git-id-list get "$1")}")
git-id "${TMP_ARR[1]}" "${TMP_ARR[2]}"
}
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
GIT_BIN=$(which git)
git() {
if [[ -z "$GIT_USER" ]]; then
$GIT_BIN "$@"
else
$GIT_BIN -c "user.name=$GIT_USER" -c "user.email=$GIT_EMAIL" -c "commit.gpgsign=false" "$@"
fi
}
# Git environment
git-env() {
git_commands=( add bisect branch checkout clone commit diff fetch grep init log merge pull push rebase reset restore show status tag )
for i in "${git_commands[@]}"
do
alias "$i"="git $i"
done
alias 'grm'='git rm'
alias 'gmv'='git mv'
}
git-unenv() {
git_commands=( add bisect branch checkout clone commit diff fetch grep init log merge pull push rebase reset restore show status tag grm gmv )
for i in "${git_commands[@]}"
do
unalias "$i"
done
}
# SSH Patch # SSH Patch
SSH_BIN=$(which ssh) [[ -z $SSH_BIN ]] && SSH_BIN=$(which ssh)
ssh() { ssh() {
if [[ "$TERM" == 'xterm-kitty' ]]; then if [[ "$TERM" == 'xterm-kitty' ]]; then
env TERM=xterm-256color "$SSH_BIN" "$@" env TERM=xterm-256color "$SSH_BIN" "$@"