Created
November 25, 2012 11:40
-
-
Save juhasz/4143203 to your computer and use it in GitHub Desktop.
Downloads and apply patches with git apply
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# apply patch with a remote patch file | |
if ! [ "$1" = "" ]; then | |
filename=/tmp/`echo $1 | sed -e 's/^.*\///'` | |
wget --output-document=$filename $1 | |
if [ "${0##*/}" = "git-apply-remote" ]; then | |
# use git apply | |
git apply -v $filename | |
else | |
patch < $filename | |
fi | |
rm $filename | |
else | |
echo 'Please give an URL to patch' | |
exit 1 | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment