diff --git a/install_nvchad.sh b/install_nvchad.sh index 8ab096c..0eaa314 100755 --- a/install_nvchad.sh +++ b/install_nvchad.sh @@ -46,9 +46,13 @@ if [ -d "$NVIM_CONFIG/.git" ]; then EXISTING_REMOTE=$(git -C "$NVIM_CONFIG" remote get-url "$REMOTE_NAME" 2>/dev/null || echo "") if [ "$EXISTING_REMOTE" = "$REPO" ]; then echo "NvChad config already installed — pulling latest..." - git -C "$NVIM_CONFIG" stash + local stashed=false + if ! git -C "$NVIM_CONFIG" diff --quiet || ! git -C "$NVIM_CONFIG" diff --cached --quiet; then + git -C "$NVIM_CONFIG" stash + stashed=true + fi git -C "$NVIM_CONFIG" pull "$REMOTE_NAME" "$BRANCH" - git -C "$NVIM_CONFIG" stash pop 2>/dev/null || true + $stashed && git -C "$NVIM_CONFIG" stash pop || true deploy_nvim echo "Done." exit 0