Enhance update script with git reset functionality

- Added a git reset --hard HEAD command to the update.sh script to ensure a clean working directory before pulling the latest changes. This helps prevent issues caused by uncommitted local changes during updates, while also logging a warning if the reset fails.
This commit is contained in:
Yury Kossakovsky
2025-05-14 14:20:51 -06:00
parent 27634c630f
commit 96e640b33c

View File

@@ -36,6 +36,7 @@ if ! command -v git &> /dev/null; then
else
# Change to project root for git pull
cd "$PROJECT_ROOT" || { log_error "Failed to change directory to $PROJECT_ROOT"; exit 1; }
git reset --hard HEAD || { log_warning "Failed to reset repository. Continuing update with potentially unreset local changes..."; }
git pull || { log_warning "Failed to pull latest repository changes. Continuing update with potentially old version of apply_update.sh..."; }
# Change back to script dir or ensure apply_update.sh uses absolute paths or cd's itself
# (apply_update.sh already handles cd to PROJECT_ROOT, so we're good)