Add debug option

This commit is contained in:
Antonin Décimo
2013-11-11 22:34:16 +01:00
parent dec003da4f
commit 149054fac9
2 changed files with 32 additions and 2 deletions

View File

@@ -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 - *-w*, generates Windows x86 and x86_64 executables
- *-w32*, generates Windows x86 executable - *-w32*, generates Windows x86 executable
- *-w64*, generates Windows x86_64 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 - *-r*, release directory. By default, a subdirectory called `releases` is created
- *-u*, company name. Provide it for OSX CFBundleIdentifier, otherwise USER is used - *-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 - *-v*, love version. Default is 0.8.0. Prior to it, no special Win64 version is available
Use `-v dev` for nightly builds Use `-v dev` for nightly builds
- *--refresh*, refresh the cache located in `~/.cache/love-release` - *--refresh*, refresh the cache located in `~/.cache/love-release`
- *--debug*, dumps script variables. Does not make releases
### SEE ALSO ### SEE ALSO
- [https://www.love2d.org](https://www.love2d.org) - [https://www.love2d.org](https://www.love2d.org)

View File

@@ -31,6 +31,7 @@ OPTIONS
Use '-v dev' for nightly builds Use '-v dev' for nightly builds
--refresh, refresh the cache located in '~/.cache/love-release' --refresh, refresh the cache located in '~/.cache/love-release'
--debug, dumps script variables. Does not make releases
SEE ALSO SEE ALSO
https://www.love2d.org 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 ## ## Set defaults ##
RELEASE_LOVE=false RELEASE_LOVE=false
RELEASE_OSX=false RELEASE_OSX=false
@@ -149,6 +169,7 @@ LOVE_SUPPORT_WIN_64=1
CACHE_DIR=~/.cache/love-release CACHE_DIR=~/.cache/love-release
CONFIG_FILE=~/.config/love-release.cfg CONFIG_FILE=~/.config/love-release.cfg
CONFIG_FOUND=false CONFIG_FOUND=false
DEBUG=false
## Config file ## ## Config file ##
@@ -222,7 +243,7 @@ fi
## Parsing options ## ## Parsing options ##
while getoptex "h; l; m; w. r: u: v: refresh" "$@" while getoptex "h; l; m; w. r: u: v: refresh debug" "$@"
do do
if [ $OPTOPT = "h" ]; then # print help if [ $OPTOPT = "h" ]; then # print help
echo "$HELP" echo "$HELP"
@@ -255,6 +276,8 @@ do
fi fi
elif [ $OPTOPT = "refresh" ]; then elif [ $OPTOPT = "refresh" ]; then
rm -rf $CACHE_DIR rm -rf $CACHE_DIR
elif [ $OPTOPT = "debug" ]; then
DEBUG=true
fi fi
done done
shift $[OPTIND-1] shift $[OPTIND-1]
@@ -270,6 +293,13 @@ if [ $RELEASE_LOVE = false ] && [ $RELEASE_OSX = false ] && [ $RELEASE_WIN_32 =
fi fi
## Debug log ##
if [ $DEBUG = true ]; then
debug
exit
fi
## Releases generation ## ## Releases generation ##
MAIN_RELEASE_DIR=${RELEASE_DIR##/*/} MAIN_RELEASE_DIR=${RELEASE_DIR##/*/}
RELEASE_DIR=$RELEASE_DIR/$LOVE_VERSION RELEASE_DIR=$RELEASE_DIR/$LOVE_VERSION