diff --git a/makepatch.sh b/makepatch.sh index 88a56b8..9c42f5e 100755 --- a/makepatch.sh +++ b/makepatch.sh @@ -15,8 +15,14 @@ then CLEAN=`find eclipse/Clean/src/main/java | grep $FILE` CAULD=`find eclipse/cauldron/src/main/java | grep $FILE` PATCH=`find patches/ | grep -i $FILE` + if [[ -z "$PATCH" ]] + then + PATCH = "patches/$FILE" + mkdir -p $PATCH + touch $PATCH + fi + echo "Diff patch of ${redf}$CLEAN${reset} and ${gref}$CAULD${reset} below." git diff --no-index --no-prefix --text $CLEAN $CAULD - echo "Diff patch of ${redf}$CLEAN${reset} and ${gref}$CAULD${reset} above." elif [ $1 == "make" ] then echo "${bluf}CREATING PATCH${reset}" @@ -24,6 +30,12 @@ then CLEAN=`find eclipse/Clean/src/main/java | grep $FILE` CAULD=`find eclipse/cauldron/src/main/java | grep $FILE` PATCH=`find patches/ | grep -i $FILE` + if [[ -z "$PATCH" ]] + then + PATCH = "patches/$FILE" + mkdir -p $PATCH + touch $PATCH + fi git diff --no-prefix --no-index --text $CLEAN $CAULD > $PATCH java makepatch $PATCH echo "Diff of ${redf}$CLEAN${reset} and ${gref}$CAULD${reset} written to ${yelf}$PATCH${reset}" @@ -33,6 +45,12 @@ else CLEAN=`find eclipse/Clean/src/main/java | grep $FILE` CAULD=`find eclipse/cauldron/src/main/java | grep $FILE` PATCH=`find patches/ | grep -i $FILE` + if [[ -z "$PATCH" ]] + then + PATCH = "patches/$FILE" + mkdir -p $PATCH + touch $PATCH + fi git diff --no-prefix --text --no-index $CLEAN $CAULD > $PATCH java makepatch $PATCH echo "Diff of ${redf}$CLEAN${reset} and ${gref}$CAULD${reset} written to ${yelf}$PATCH${reset}"