From fbfb628a59a7604f3e9690651d208e1b7d5b8b4a Mon Sep 17 00:00:00 2001 From: IVA2K Date: Wed, 10 Jan 2024 12:18:49 -0800 Subject: [PATCH] Add conflict auto-resolution attempt for pnpm-lock.yaml file. --- scripts/git-merge_main-to-all-ui.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/scripts/git-merge_main-to-all-ui.sh b/scripts/git-merge_main-to-all-ui.sh index 8c4869e..4b2121b 100644 --- a/scripts/git-merge_main-to-all-ui.sh +++ b/scripts/git-merge_main-to-all-ui.sh @@ -35,8 +35,20 @@ for TARGET_BRANCH in "${TARGET_BRANCHES[@]}"; do # Check for merge conflicts if [ $? -ne 0 ]; then - echo "Merge conflict detected in \"$TARGET_BRANCH\" branch. Please resolve conflicts manually, push changes, and run the script again." - exit 1 + echo "Merge conflict detected in \"$TARGET_BRANCH\" branch." + echo " Recreating 'pnpm-lock.yaml' as most likely attempt to resolve conflicts..." + (git checkout HEAD -- pnpm-lock.yaml && pnpm install && git add pnpm-lock.yaml) + echo " DONE Recreating 'pnpm-lock.yaml'." + if git diff --name-only --diff-filter=U | grep -q .; then + echo " There are remaining unresolved Git conflicts:" + git diff --name-only --diff-filter=U + echo " Please resolve any remaining Git conflicts manually, commit and push changes, and run the script again." + exit 1 + else + echo "No unresolved Git conflicts found, continuing..." + git commit + fi + fi # Push the changes to the remote repository