diff --git a/zsh/zshrc b/zsh/zshrc index a9f2a3e..b80b1cb 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -16,7 +16,7 @@ export ZSHRC_BOOTSTRAP="$ZSH_CONFIG/.bootstrapped" update_zshrc(){ local tmp=/tmp/.zshrc.$$ - curl -sSL --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 if zsh -n "$tmp" 2>/dev/null && ! cmp -s "$tmp" "$HOME/.zshrc" 2>/dev/null; then echo "Updating zshrc..." mv "$tmp" "$HOME/.zshrc" && echo "Updated. Reloading..." && exec zsh @@ -35,7 +35,7 @@ install_opencode(){ # Bootstrap: download and run once per bootstrap version if [[ ! -f "$ZSHRC_BOOTSTRAP" || "$(cat "$ZSHRC_BOOTSTRAP" 2>/dev/null)" != "$ZSHRC_BOOTSTRAP_VERSION" || "$BOOTSTRAP" == "true" ]]; then tmp=/tmp/.zshrc_bootstrap.$$ - curl -sSL --connect-timeout 5 --max-time 10 -o "$tmp" "$ZSHRC_BOOTSTRAP_URL" 2>/dev/null + curl -fsSL --connect-timeout 5 --max-time 10 -o "$tmp" "$ZSHRC_BOOTSTRAP_URL" 2>/dev/null if [[ -f "$tmp" ]]; then zsh "$tmp" 2>/dev/null echo "$ZSHRC_BOOTSTRAP_VERSION" > "$ZSHRC_BOOTSTRAP" @@ -46,13 +46,13 @@ fi TMUXCONF="$HOME/.config/tmux" BYOBUCONF="$HOME/.config/byobu" TMUXREMOTE="$ZSHRC_GIT/tmux.conf" -if [ ! -f "$TMUXCONF" ]; then +if [ ! -f "$TMUXCONF/tmux.conf" ] && [ ! -f "$BYOBUCONF/.tmux.conf" ]; then # Create a secure temporary file TEMP_TMUXCONF=$(mktemp) - - # Download to temp file. + + # Download to temp file. # The '&&' ensures the 'mv' only runs if curl succeeds (exit code 0). - if curl -sSL --connect-timeout 5 --max-time 10 -o "$TEMP_TMUXCONF" "$TMUXREMOTE"; then + if curl -fsSL --connect-timeout 5 --max-time 10 -o "$TEMP_TMUXCONF" "$TMUXREMOTE"; then mkdir -p "$TMUXCONF" "$BYOBUCONF" cp "$TEMP_TMUXCONF" "$TMUXCONF/tmux.conf" mv "$TEMP_TMUXCONF" "$BYOBUCONF/.tmux.conf" @@ -130,7 +130,7 @@ alias yeet='yay -Rcs' # Auto-update: check every shell start, silently fail if server unreachable if [[ -o interactive ]]; then tmp=/tmp/.zshrc.$$ - curl -sSL --connect-timeout 3 --max-time 8 "$ZSHRC_URL" -o "$tmp" 2>/dev/null + curl -fsSL --connect-timeout 3 --max-time 8 "$ZSHRC_URL" -o "$tmp" 2>/dev/null if [[ -f "$tmp" ]] && zsh -n "$tmp" 2>/dev/null && ! cmp -s "$tmp" "$HOME/.zshrc" 2>/dev/null; then echo "Updating zshrc..." mv "$tmp" "$HOME/.zshrc" && exec zsh