AllSpice-Loves-SVN-Monorepos/.allspice/pre-push
2025-03-03 22:51:34 +00:00

21 lines
632 B
Bash

#!/bin/bash
echo "[ ] Running pre-push hook..."
# Step 3: Push changes to SVN
git svn dcommit || { echo "[ ] SVN sync failed!"; exit 1; }
# Define colors
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color
# Step 5: Push changes **only once** after ensuring sync
echo "[ ] Pushing to Git..."
git push --no-verify origin git-svn || { echo "Push failed!"; exit 1; }
echo "[ ] Successfully synced to SVN and pushed to Git!"
echo " "
echo -e "${GREEN}ignore the following error message ${NC}"
echo -e "${GREEN}error: failed to push some refs to https://your allspice server/your organization/your repo.git ${NC}"
exit 1