zsh: add dev branch toggle (usedev/usemaster)

This commit is contained in:
2026-08-01 01:09:29 -04:00
parent 7acdb761d6
commit b51a14e3d8
+23 -1
View File
@@ -2,7 +2,8 @@ export ZSH_CONFIG=$HOME/.config/zsh
export OHMYZSH=$ZSH_CONFIG/oh-my-zsh export OHMYZSH=$ZSH_CONFIG/oh-my-zsh
export OHMYZSH_CUSTOM=$OHMYZSH/custom export OHMYZSH_CUSTOM=$OHMYZSH/custom
export ZSHRC_GIT="https://git.jeremymcclure.com/jeremy/scripts/raw/branch/master/zsh/" export ZSHRC_BRANCH="${ZSHRC_BRANCH:-$(cat "$ZSH_CONFIG/branch" 2>/dev/null || echo master)}"
export ZSHRC_GIT="https://git.jeremymcclure.com/jeremy/scripts/raw/branch/${ZSHRC_BRANCH}/zsh/"
export ZSHRC_URL="$ZSHRC_GIT/zshrc" export ZSHRC_URL="$ZSHRC_GIT/zshrc"
export ZSHRC_BOOTSTRAP_URL="$ZSHRC_GIT/zshrc-bootstrap.zsh" export ZSHRC_BOOTSTRAP_URL="$ZSHRC_GIT/zshrc-bootstrap.zsh"
@@ -14,6 +15,25 @@ export ZSHRC_BOOTSTRAP="$ZSH_CONFIG/.bootstrapped"
[[ -d "$HOME/AppImages" ]] && path+=("$HOME/AppImages") [[ -d "$HOME/AppImages" ]] && path+=("$HOME/AppImages")
[[ -d "$HOME/.opencode/bin" ]] && path+=("$HOME/.opencode/bin") [[ -d "$HOME/.opencode/bin" ]] && path+=("$HOME/.opencode/bin")
use_dev_branch(){
mkdir -p "$ZSH_CONFIG"
echo "dev" > "$ZSH_CONFIG/branch"
export ZSHRC_BRANCH=dev
export ZSHRC_GIT="https://git.jeremymcclure.com/jeremy/scripts/raw/branch/dev/zsh/"
export ZSHRC_URL="$ZSHRC_GIT/zshrc"
export ZSHRC_BOOTSTRAP_URL="$ZSHRC_GIT/zshrc-bootstrap.zsh"
echo "Switched to dev branch. Run 'update_zshrc' to pull latest."
}
use_master_branch(){
rm -f "$ZSH_CONFIG/branch"
export ZSHRC_BRANCH=master
export ZSHRC_GIT="https://git.jeremymcclure.com/jeremy/scripts/raw/branch/master/zsh/"
export ZSHRC_URL="$ZSHRC_GIT/zshrc"
export ZSHRC_BOOTSTRAP_URL="$ZSHRC_GIT/zshrc-bootstrap.zsh"
echo "Switched to master branch. Run 'update_zshrc' to pull latest."
}
update_zshrc(){ update_zshrc(){
local tmp=/tmp/.zshrc.$$ local tmp=/tmp/.zshrc.$$
curl -fsSL --connect-timeout 5 --max-time 10 "$ZSHRC_URL" -o "$tmp" 2>/dev/null || return curl -fsSL --connect-timeout 5 --max-time 10 "$ZSHRC_URL" -o "$tmp" 2>/dev/null || return
@@ -170,6 +190,8 @@ command -v delta >/dev/null && export GIT_PAGER='delta'
alias c='clear' alias c='clear'
alias q="exit" alias q="exit"
alias usedev='use_dev_branch'
alias usemaster='use_master_branch'
alias nbstat=$'netbird status --json | jq -r \'.peers.details[]? | [(.hostname // .fqdn), .netbirdIp, .status] | @tsv\' | column -t -s $\'\\t\'' alias nbstat=$'netbird status --json | jq -r \'.peers.details[]? | [(.hostname // .fqdn), .netbirdIp, .status] | @tsv\' | column -t -s $\'\\t\''
alias open-ports="ss -tulpn | grep LISTEN" alias open-ports="ss -tulpn | grep LISTEN"
alias yeet='yay -Rcs' alias yeet='yay -Rcs'