diff --git a/home/dot_local/bin/executable_full-upgrade.tmpl b/home/dot_local/bin/executable_full-upgrade.tmpl index 61b6460..d3d2b2f 100644 --- a/home/dot_local/bin/executable_full-upgrade.tmpl +++ b/home/dot_local/bin/executable_full-upgrade.tmpl @@ -30,12 +30,18 @@ if [[ "${CONTINUE_FROM_DOTFILES:-false}" == false ]]; then if chezmoi --version &>/dev/null; then log_task "Updating dotfiles" - # Pull latest changes from dotfiles repo + if chezmoi git -- status --porcelain | grep -q .; then - log_manual_action "Not running chezmoi update as uncommitted dotfiles changes were found" + log_manual_action "Skipping chezmoi update as uncommitted changes were found" + elif ! chezmoi git -- branch --show-current | grep -q .; then + log_manual_action "Skipping chezmoi update as the current branch could not be determined" + elif chezmoi git -- log '@{u}..' | grep -q .; then + log_manual_action "Skipping chezmoi update as unpushed changes were found" else + # Pull latest changes from dotfiles repo c chezmoi update --apply=false fi + # Apply changes to chezmoi config c chezmoi init --force # Apply the rest