Fix MacOS icns, dropped version detection

This commit is contained in:
Antonin Décimo
2014-05-01 12:35:08 +02:00
parent bf14ac7066
commit a0339927e9
2 changed files with 8 additions and 31 deletions

View File

@@ -9,7 +9,6 @@ You can use love-release.sh to generate Love 2D game applications and get over t
The script fully supports Windows, MacOS either on x86 or x64. The script fully supports Windows, MacOS either on x86 or x64.
It needs an Internet connection to download Love files, and relies on curl, zip and unzip commands. It needs an Internet connection to download Love files, and relies on curl, zip and unzip commands.
To set the default Love version to use, you can edit the very beginning of the script. To set the default Love version to use, you can edit the very beginning of the script.
If a `conf.lua` file is provided, the script will try to detect the right version of Love to use.
If a `ProjectName.icns` file is provided, the script will use it to set the game icon on MacOS. If a `ProjectName.icns` file is provided, the script will use it to set the game icon on MacOS.
### OPTIONS ### OPTIONS

View File

@@ -35,7 +35,6 @@ DESCRIPTION
The script fully supports Windows, MacOS either on x86 or x64. The script fully supports Windows, MacOS either on x86 or x64.
It needs an Internet connection to download Love files, and relies on curl, zip and unzip commands. It needs an Internet connection to download Love files, and relies on curl, zip and unzip commands.
To set the default Love version to use, you can edit the very beginning of the script. To set the default Love version to use, you can edit the very beginning of the script.
If a conf.lua file is provided, the script will try to detect the right version of Love to use.
If a ProjectName.icns file is provided, the script will use it to set the game icon on MacOS. If a ProjectName.icns file is provided, the script will use it to set the game icon on MacOS.
OPTIONS OPTIONS
@@ -183,22 +182,15 @@ RELEASE_LOVE=false
RELEASE_OSX=false RELEASE_OSX=false
RELEASE_WIN_32=false RELEASE_WIN_32=false
RELEASE_WIN_64=false RELEASE_WIN_64=false
LOVE_VERSION_MAJOR=`echo "$LOVE_VERSION" | grep -Eo '^[0-9]+\.?[0-9]*'`
LOVE_GT_080=`echo "$LOVE_VERSION_MAJOR>=0.8" | bc`
LOVE_GT_090=`echo "$LOVE_VERSION_MAJOR>=0.9" | bc`
PROJECT_FILES= PROJECT_FILES=
PROJECT_NAME=${PWD##/*/} PROJECT_NAME=${PWD##/*/}
COMPANY_NAME=love2d COMPANY_NAME=love2d
RELEASE_DIR=$PWD/releases RELEASE_DIR=$PWD/releases
if [ -f $PWD/conf.lua ]; then
LOVE_VERSION_CONF=`grep -Eo 'version = "[0-9]+.[0-9]+.[0-9]+"' $PWD/conf.lua | grep -Eo '[0-9]+.[0-9]+.[0-9]+'`
if [ -n $LOVE_VERSION_CONF ]; then
LOVE_VERSION=$LOVE_VERSION_CONF
fi
fi
LOVE_VERSION_MAJOR=`echo "$LOVE_VERSION" | grep -Eo '^[0-9]+\.?[0-9]*'`
LOVE_GT_080=`echo "$LOVE_VERSION_MAJOR>=0.8" | bc`
LOVE_GT_090=`echo "$LOVE_VERSION_MAJOR>=0.9" | bc`
DEBUG=false DEBUG=false
CACHE_DIR=~/.cache/love-release CACHE_DIR=~/.cache/love-release
@@ -218,7 +210,6 @@ PROJECT_NAME=$PROJECT_NAME
COMPANY_NAME=$COMPANY_NAME COMPANY_NAME=$COMPANY_NAME
RELEASE_DIR=$RELEASE_DIR RELEASE_DIR=$RELEASE_DIR
LOVE_VERSION=$LOVE_VERSION LOVE_VERSION=$LOVE_VERSION
LOVE_VERSION_CONF=$LOVE_VERSION_CONF
LOVE_VERSION_MAJOR=$LOVE_VERSION_MAJOR LOVE_VERSION_MAJOR=$LOVE_VERSION_MAJOR
CACHE_DIR=$CACHE_DIR CACHE_DIR=$CACHE_DIR
PROJECT_ICNS=$PROJECT_ICNS" PROJECT_ICNS=$PROJECT_ICNS"
@@ -251,23 +242,10 @@ do
elif [ $OPTOPT = "u" ]; then elif [ $OPTOPT = "u" ]; then
COMPANY_NAME=$OPTARG COMPANY_NAME=$OPTARG
elif [ $OPTOPT = "v" ]; then elif [ $OPTOPT = "v" ]; then
if [ -n $LOVE_VERSION_CONF ] && [ -n $OPTARG ] && [ $LOVE_VERSION_CONF != $OPTARG ]; then
echo "The version of $PROJECT_NAME found in conf.lua does not match the one you specified."
read -p "Keep the old one ? [Y/n] " yn;
case $yn in
[Yy]* ) ;;
* )
LOVE_VERSION=$OPTARG
LOVE_VERSION_MAJOR=`echo "$LOVE_VERSION" | grep -Eo '^[0-9]+\.?[0-9]*'`
LOVE_GT_080=`echo "$LOVE_VERSION_MAJOR>=0.8" | bc`
LOVE_GT_090=`echo "$LOVE_VERSION_MAJOR>=0.9" | bc`;;
esac
else
LOVE_VERSION=$OPTARG LOVE_VERSION=$OPTARG
LOVE_VERSION_MAJOR=`echo "$LOVE_VERSION" | grep -Eo '^[0-9]+\.?[0-9]*'` LOVE_VERSION_MAJOR=`echo "$LOVE_VERSION" | grep -Eo '^[0-9]+\.?[0-9]*'`
LOVE_GT_080=`echo "$LOVE_VERSION_MAJOR>=0.8" | bc` LOVE_GT_080=`echo "$LOVE_VERSION_MAJOR>=0.8" | bc`
LOVE_GT_090=`echo "$LOVE_VERSION_MAJOR>=0.9" | bc` LOVE_GT_090=`echo "$LOVE_VERSION_MAJOR>=0.9" | bc`
fi
elif [ $OPTOPT = "debug" ]; then elif [ $OPTOPT = "debug" ]; then
DEBUG=true DEBUG=true
elif [ $OPTOPT = "help" ]; then elif [ $OPTOPT = "help" ]; then
@@ -292,7 +270,7 @@ MAIN_RELEASE_DIR=${RELEASE_DIR##/*/}
RELEASE_DIR=$RELEASE_DIR/$LOVE_VERSION RELEASE_DIR=$RELEASE_DIR/$LOVE_VERSION
CACHE_DIR=$CACHE_DIR/$LOVE_VERSION CACHE_DIR=$CACHE_DIR/$LOVE_VERSION
if [ -f $PWD/$PROJECT_NAME.icns ]; then if [ -f $PWD/$PROJECT_NAME.icns ]; then
PROJECT_ICNS=$PWD/$PROJECT_FILES.icns PROJECT_ICNS=$PWD/$PROJECT_NAME.icns
else else
PROJECT_ICNS= PROJECT_ICNS=
fi fi