Skip to content

Commit 65ce215

Browse files
authored
Update post-build.sh to delete dist branch
...if it exists, and create a new branch every time to avoid the divergent branch issue.
1 parent e8297c8 commit 65ce215

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

post-build.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,13 @@ echo ">>>Running post-build.sh"
2020

2121
# Create dist branch if it doesn't exist already
2222
if ! git show-ref --verify --quiet refs/heads/dist; then
23-
# Create the dist branch if it doesn't exist
24-
git branch dist
23+
# Delete the dist branch locally
24+
git branch -D dist
25+
# Delete the dist branch remotely
26+
git push origin --delete dist
2527
fi
2628

27-
git pull origin dist || true
28-
29-
# Checkout the dist branch
30-
git checkout dist || git checkout -b dist
29+
git checkout -b dist
3130

3231
# Add and commit the changes to the dist folder
3332
git add dist

0 commit comments

Comments
 (0)