diff --git a/createRelease.sh b/createRelease.sh new file mode 100755 index 0000000..d7d2f67 --- /dev/null +++ b/createRelease.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env zsh + +# project prefix +PREFIX="175-BreakoutA" + +# get versioning +echo -n "Type your tag version for '$PREFIX' (like (2.1) followed by [ENTER] for ${PREFIX}2.1): " +read VERSION +echo "Your version: ${PREFIX}${VERSION}" + +# to CTRL-C +echo -n "Press any key to continue..." +read -n 1 + +if [ -d "./src/break_out" ] && [ -f ".gitignore" ]; +then + ln -s ./ "${PREFIX}${VERSION}" # create temporary soft link + + #update .project version + xmlstarlet edit -L -u "//projectDescription/name" -v "${PREFIX}${VERSION}" .project + + # file list + FILELIST=('.idea' 'doc' 'libs' 'res' 'src' '.classpath' '.project' 'README.md') + for i in "${FILELIST[@]}"; do + zip -r "${PREFIX}${VERSION}".zip "./${PREFIX}${VERSION}/${i}" + done + + rm "${PREFIX}${VERSION}" # remove soft link + echo "Have fun" +else + echo "You are not in the correct working directory" +fi \ No newline at end of file