From 53d57cada9670c7afa8f357533b3863b9b4919a7 Mon Sep 17 00:00:00 2001 From: ME1312 Date: Thu, 24 Aug 2017 10:28:00 -0400 Subject: [PATCH] Generate difference list --- Artifacts/SubServers.Bungee.Patcher.sh | 36 ++++++++++++++++++-------- LICENSE | 2 +- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/Artifacts/SubServers.Bungee.Patcher.sh b/Artifacts/SubServers.Bungee.Patcher.sh index 5142a54d..e895ecf0 100644 --- a/Artifacts/SubServers.Bungee.Patcher.sh +++ b/Artifacts/SubServers.Bungee.Patcher.sh @@ -26,37 +26,51 @@ if [ -d "Buildtools" ]; then rm -Rf Buildtools fi mkdir BuildTools -cd BuildTools +mkdir BuildTools/Vanilla.jar +mkdir BuildTools/Modded.jar +cd BuildTools/Modded.jar echo ">> Extracting $1..." -jar xvf ../$1; retvala=$?; +jar xvf ../../$1; retvala=$?; if [ $retvala -eq 0 ] then + if [ -f "LICENSE.txt" ]; then + rm -Rf LICENSE.txt + fi + if [ -f "LICENSE" ]; then + rm -Rf LICENSE + fi + cd ../Vanilla.jar echo ">> Extracting $2..." - jar xvf ../$2; retvalb=$?; + jar xvf ../../$2; retvalb=$?; if [ $retvalb -eq 0 ] then - if [ -d "../SubServers.Patched.jar" ]; then - rm -Rf ../SubServers.Patched.jar - fi + echo ">> Writing Changes..." + yes | cp -rf . ../Modded.jar + printf "\n " >> META-INF/MANIFEST.MF + cd ../ + printf "# SubServers.Bungee.Patcher generated difference list (may be empty if git is not installed)\n#\n> git --no-pager diff --no-index --name-status BuildTools/Vanilla.jar BuildTools/Modded.jar\n" > MODIFICATIONS + git --no-pager diff --no-index --name-status Vanilla.jar Modded.jar | sed -e "s/\tVanilla.jar\//\t\//" -e "s/\tModded.jar\//\t\//" >> MODIFICATIONS + mv -f MODIFICATIONS Modded.jar + cd Modded.jar echo ">> Recompiling..." - jar cvfm ../SubServers.Patched.jar META-INF/MANIFEST.MF .; retvalc=$?; + jar cvfm ../../SubServers.Patched.jar META-INF/MANIFEST.MF .; retvalc=$?; if [ $retvalc -eq 0 ] then echo ">> Cleaning Up..." - rm -Rf ../Buildtools + rm -Rf ../../Buildtools exit 0; else echo ">> Error Recomiling Files" - rm -Rf ../Buildtools + rm -Rf ../../Buildtools exit 4 fi else echo ">> Error Decompiling $2 Files" - rm -Rf ../Buildtools + rm -Rf ../../Buildtools exit 3 fi else echo ">> Error Decompiling $1 Files" - rm -Rf ../Buildtools + rm -Rf ../../Buildtools exit 3 fi \ No newline at end of file diff --git a/LICENSE b/LICENSE index 8dada3ed..0bec3aa1 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright {yyyy} {name of copyright owner} + Copyright 2017 ME1312 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.