Compare commits
10 Commits
ed271e260e
...
v1.9.0
| Author | SHA1 | Date | |
|---|---|---|---|
| cb68e1fb5c | |||
| 1bd7c6aba5 | |||
| 8b0e130b08 | |||
| bd1d33a157 | |||
| b70a89ec86 | |||
| da28305c2d | |||
| fecb5c50ea | |||
| b4b81a8315 | |||
| 98fb6e363f | |||
| a3061b501a |
@@ -30,16 +30,24 @@ do
|
||||
git tag -f "$TAG" > /dev/null
|
||||
|
||||
echo "✅ Tag $TAG has been updated locally with synced versions."
|
||||
echo "🚀 Auto-pushing updated tag..."
|
||||
|
||||
# Push the updated tag directly (using --no-verify to avoid recursion)
|
||||
# Push branch AND tag directly inside the hook because Git native push has already recorded the old SHA
|
||||
CURRENT_BRANCH=$(git branch --show-current)
|
||||
if [ -n "$CURRENT_BRANCH" ]; then
|
||||
git push origin "$CURRENT_BRANCH" --no-verify
|
||||
fi
|
||||
git push origin "$TAG" --force --no-verify
|
||||
|
||||
echo "✨ Success! The hook synchronized the versions and pushed the updated tag for you."
|
||||
echo "ℹ️ Note: The original push command was aborted in favor of the auto-push. This is normal."
|
||||
exit 0 # Change to exit 0 to not show as an 'error' in vscode/terminal, though original push will still be technically 'failed' by git
|
||||
echo ""
|
||||
echo "✨ VERSIONS SYNCED & PUSHED SUCCESSFULLY ✨"
|
||||
echo "The correct commit has been tagged on origin."
|
||||
echo "(Info: You will see a 'pre-push hook failed' and 'failed to push' error below. Please completely ignore it. We MUST abort the native git push, otherwise Git would push the pre-sync commit to the tag and break the version history.)"
|
||||
echo ""
|
||||
|
||||
# We MUST exit 1, otherwise native Git will push the wrong commit to the tag
|
||||
exit 1
|
||||
else
|
||||
echo "✨ Versions already in sync for $TAG."
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user