Skip to content

Commit bdb4cca

Browse files
authored
⚡ Optimize shell startup: run dotfiles git fetch in background (#13)
Backgrounds the git fetch operation in tools/update.sh to prevent blocking shell initialization. This improves login time significantly by decoupling the network operation from the startup check.
1 parent 4ad9b87 commit bdb4cca

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tools/update.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ command -v chezmoi &>/dev/null || { say "chezmoi not installed"; exit 1; }
1414
[[ -d "$DOTFILES_DIR/.git" ]] || exit 0
1515

1616
# Check if remote has updates
17-
git -C "$DOTFILES_DIR" fetch --quiet 2>/dev/null
17+
git -C "$DOTFILES_DIR" fetch --quiet 2>/dev/null &
1818
LOCAL=$(git -C "$DOTFILES_DIR" rev-parse '@' 2>/dev/null)
1919
REMOTE=$(git -C "$DOTFILES_DIR" rev-parse '@{u}' 2>/dev/null)
2020

0 commit comments

Comments
 (0)