32 lines
878 B
Bash
32 lines
878 B
Bash
#!/bin/bash
|
|
|
|
# Run regular git push if arguments are passed
|
|
if [ "$#" -gt 0 ]; then
|
|
echo "Git push with arguments detected: $@"
|
|
git push "$@"
|
|
exit $? # Exit with the same status as git push
|
|
fi
|
|
|
|
# No arguments passed, run our custom flow
|
|
echo "No arguments passed, running pre-push script..."
|
|
|
|
|
|
# Step 3: Push changes to SVN
|
|
echo "Pushing changes to SVN..."
|
|
git svn dcommit || { echo "[ ] SVN sync failed!"; exit 1; }
|
|
|
|
# # Run the pre-push script
|
|
# echo "Running pre-push checks..."
|
|
# .allspice/scripts/pre-push.sh || { echo "Pre-push failed, aborting push."; exit 1; }
|
|
|
|
# Run git push
|
|
echo "Pushing to remote..."
|
|
git push origin git-svn || { echo "git push origin git-svn Push failed!"; exit 1; }
|
|
|
|
# # Run cleanup
|
|
# echo "Running cleanup..."
|
|
# .allspice/scripts/post-push.sh || { echo "Cleanup failed."; exit 1; }
|
|
|
|
echo "Push and cleanup completed successfully."
|
|
|