Created
December 17, 2013 15:54
-
-
Save goldbattle/8007145 to your computer and use it in GitHub Desktop.
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
BRANCH=master | |
REMOTE_REPOSITORY=https://github.com/Soartex-Modded/Modded-1.6.x.git | |
TMP_DIR=./tmp/modded-1.6.x/ | |
TARGET_DIR=./modded-1.6.x/ | |
VERSION_FILE=./$TARGET_DIR/version.txt | |
# Clone data from github | |
git clone --depth=1 --branch $BRANCH $REMOTE_REPOSITORY $TMP_DIR | |
# Fetch information | |
git fetch origin $BRANCH | |
# Hard reset git clone | |
git --git-dir="$TMP_DIR.git" --work-tree="$TMP_DIR" reset --hard origin/$BRANCH | |
# Pull the changes | |
git pull | |
# Not sure what this does. | |
git submodule update --init --recursive | |
# Create a version file we use in the zipmanger | |
git --git-dir="$TMP_DIR.git" --work-tree="$TMP_DIR" describe --always > $VERSION_FILE | |
# Create target zip directory if needed | |
if ![test -d $TARGET_DIR]; then mkdir $TARGET_DIR; fi | |
# Zip files, only if changed | |
for i in */; do cd "${i%/}"; zip -u -r "../$TARGET_DIR${i%/}.zip" "."; cd ../; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment