From 57a402ed0049e9fe3318707918a59b9950293f52 Mon Sep 17 00:00:00 2001 From: nsubiron Date: Wed, 24 Jan 2018 19:47:57 +0100 Subject: [PATCH] Some improvements to Package.sh --- Package.sh | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/Package.sh b/Package.sh index b175a6969..123c0bd89 100755 --- a/Package.sh +++ b/Package.sh @@ -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 -------------------------------------------------------- # ==============================================================================