Some improvements to Package.sh

This commit is contained in:
nsubiron 2018-01-24 19:47:57 +01:00
parent 78db608bcb
commit 57a402ed00
1 changed files with 22 additions and 3 deletions

View File

@ -9,7 +9,7 @@ set -e
DOC_STRING="Makes a packaged version of CARLA for distribution.
Please make sure to run Rebuild.sh before!"
USAGE_STRING="Usage: $0 [-h|--help] [--skip-packaging]"
USAGE_STRING="Usage: $0 [-h|--help] [--no-packaging] [--no-zip] [--clean-intermediate]"
# ==============================================================================
# -- Parse arguments -----------------------------------------------------------
@ -18,8 +18,9 @@ USAGE_STRING="Usage: $0 [-h|--help] [--skip-packaging]"
DO_PACKAGE=true
DO_COPY_FILES=true
DO_TARBALL=true
DO_CLEAN_INTERMEDIATE=false
OPTS=`getopt -o h --long help,skip-packaging -n 'parse-options' -- "$@"`
OPTS=`getopt -o h --long help,no-packaging,no-zip,clean-intermediate -n 'parse-options' -- "$@"`
if [ $? != 0 ] ; then echo "$USAGE_STRING" ; exit 2 ; fi
@ -27,9 +28,15 @@ eval set -- "$OPTS"
while true; do
case "$1" in
--skip-packaging )
--no-packaging )
DO_PACKAGE=false
shift ;;
--no-zip )
DO_TARBALL=false
shift ;;
--clean-intermediate )
DO_CLEAN_INTERMEDIATE=true
shift ;;
-h | --help )
echo "$DOC_STRING"
echo "$USAGE_STRING"
@ -145,6 +152,18 @@ if $DO_TARBALL ; then
fi
# ==============================================================================
# -- Remove intermediate files -------------------------------------------------
# ==============================================================================
if $DO_CLEAN_INTERMEDIATE ; then
log "Removing intermediate build..."
rm -Rf ${BUILD_FOLDER}
fi
# ==============================================================================
# -- ...and we are done --------------------------------------------------------
# ==============================================================================