Files
sm64coopdx/tools/create_patch.sh
ManIsCat2 475502d0c3 sound
2024-11-26 16:27:37 +03:30

20 lines
533 B
Bash
Executable File

#!/bin/sh
#
# create_patch.sh - Creates an enhancement patch based on the current Git changes
#
if [ "$#" -ne 1 ]
then
echo "Usage: $0 patch_file"
echo ' Creates a patch file based on the changes made to the current directory'
exit 1
fi
# 'git diff' is stupid and doesn't show new untracked files, so we must add them first.
# Also make sure this is a valid git repository, throw an error otherwise ( || exit 1 )
git add . || exit 1
# Generate the patch.
git diff -p --staged > "$1"
# Undo the 'git add'.
git reset