From 149054fac9df8e8a77a381024a1c7a6dcd87d5da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonin=20D=C3=A9cimo?= Date: Mon, 11 Nov 2013 22:34:16 +0100 Subject: [PATCH] Add debug option --- README.md | 2 +- love-release.sh | 32 +++++++++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 012f36a..9ac3945 100644 --- a/README.md +++ b/README.md @@ -19,12 +19,12 @@ A directory (default is `./releases`) will be created, and filled with the zippe - *-w*, generates Windows x86 and x86_64 executables - *-w32*, generates Windows x86 executable - *-w64*, generates Windows x86_64 executable -- *-n*, project's name. By default, the directory's name is used - *-r*, release directory. By default, a subdirectory called `releases` is created - *-u*, company name. Provide it for OSX CFBundleIdentifier, otherwise USER is used - *-v*, love version. Default is 0.8.0. Prior to it, no special Win64 version is available Use `-v dev` for nightly builds - *--refresh*, refresh the cache located in `~/.cache/love-release` +- *--debug*, dumps script variables. Does not make releases ### SEE ALSO - [https://www.love2d.org](https://www.love2d.org) diff --git a/love-release.sh b/love-release.sh index f2adf2f..e4e6986 100755 --- a/love-release.sh +++ b/love-release.sh @@ -31,6 +31,7 @@ OPTIONS Use '-v dev' for nightly builds --refresh, refresh the cache located in '~/.cache/love-release' + --debug, dumps script variables. Does not make releases SEE ALSO https://www.love2d.org @@ -135,6 +136,25 @@ function getoptex() } +## Debug function ## +function debug() +{ + echo "PROJECT_NAME: $PROJECT_NAME" + echo "COMPANY_NAME: $COMPANY_NAME" + echo "RELEASE_LOVE: $RELEASE_LOVE" + echo "RELEASE_OSX: $RELEASE_OSX" + echo "RELEASE_WIN_32: $RELEASE_WIN_32" + echo "RELEASE_WIN_64: $RELEASE_WIN_64" + echo "LOVE_VERSION: $LOVE_VERSION" + echo "LOVE_SUPPORT_WIN_64: $LOVE_SUPPORT_WIN_64" + echo "RELEASE_DIR: $RELEASE_DIR" + echo "CACHE_DIR: $CACHE_DIR" + echo "CONFIG_FILE: $CONFIG_FILE" + echo "CONFIG_FOUND: $CONFIG_FOUND" + echo "DEBUG: $DEBUG" +} + + ## Set defaults ## RELEASE_LOVE=false RELEASE_OSX=false @@ -149,6 +169,7 @@ LOVE_SUPPORT_WIN_64=1 CACHE_DIR=~/.cache/love-release CONFIG_FILE=~/.config/love-release.cfg CONFIG_FOUND=false +DEBUG=false ## Config file ## @@ -222,7 +243,7 @@ fi ## Parsing options ## -while getoptex "h; l; m; w. r: u: v: refresh" "$@" +while getoptex "h; l; m; w. r: u: v: refresh debug" "$@" do if [ $OPTOPT = "h" ]; then # print help echo "$HELP" @@ -255,6 +276,8 @@ do fi elif [ $OPTOPT = "refresh" ]; then rm -rf $CACHE_DIR + elif [ $OPTOPT = "debug" ]; then + DEBUG=true fi done shift $[OPTIND-1] @@ -270,6 +293,13 @@ if [ $RELEASE_LOVE = false ] && [ $RELEASE_OSX = false ] && [ $RELEASE_WIN_32 = fi +## Debug log ## +if [ $DEBUG = true ]; then + debug + exit +fi + + ## Releases generation ## MAIN_RELEASE_DIR=${RELEASE_DIR##/*/} RELEASE_DIR=$RELEASE_DIR/$LOVE_VERSION