From 701e10b87ff7f30e648ecc2f4e8b82002839473e Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Thu, 24 Aug 2017 22:15:21 +0100 Subject: [PATCH] Default packaging output to current working directory. --- packaging/osx/buildpackage.sh | 11 ++++++++--- packaging/package-all.sh | 21 ++++++++++++++------- packaging/windows/buildpackage.sh | 11 ++++++++--- 3 files changed, 30 insertions(+), 13 deletions(-) diff --git a/packaging/osx/buildpackage.sh b/packaging/osx/buildpackage.sh index f2cdf65..2b51cae 100755 --- a/packaging/osx/buildpackage.sh +++ b/packaging/osx/buildpackage.sh @@ -6,8 +6,8 @@ command -v make >/dev/null 2>&1 || { echo >&2 "The OpenRA mod template requires command -v python >/dev/null 2>&1 || { echo >&2 "The OpenRA mod template requires python."; exit 1; } command -v curl >/dev/null 2>&1 || { echo >&2 "The OpenRA mod template requires curl."; exit 1; } -if [ $# -ne "2" ]; then - echo "Usage: `basename $0` tag outputdir" +if [ $# -eq "0" ]; then + echo "Usage: `basename $0` version [outputdir]" exit 1 fi @@ -29,7 +29,12 @@ if [ "${INCLUDE_DEFAULT_MODS}" = "True" ]; then fi TAG="$1" -OUTPUTDIR=$(python -c "import os; print(os.path.realpath('$2'))") +if [ $# -eq "1" ]; then + OUTPUTDIR=$(python -c "import os; print(os.path.realpath('.'))") +else + OUTPUTDIR=$(python -c "import os; print(os.path.realpath('$2'))") +fi + BUILTDIR="${PACKAGING_DIR}/build" PACKAGING_OSX_APP_NAME="OpenRA - ${PACKAGING_DISPLAY_NAME}.app" diff --git a/packaging/package-all.sh b/packaging/package-all.sh index fc91c73..d667159 100755 --- a/packaging/package-all.sh +++ b/packaging/package-all.sh @@ -1,9 +1,16 @@ #!/bin/bash set -e -if [ $# -ne "2" ]; then - echo "Usage: `basename $0` version outputdir" - exit 1 +if [ $# -eq "0" ]; then + echo "Usage: `basename $0` version [outputdir]" + exit 1 +fi + +TAG="$1" +if [ $# -eq "1" ]; then + OUTPUTDIR=$(pwd) +else + OUTPUTDIR=$2 fi command -v python >/dev/null 2>&1 || { echo >&2 "The OpenRA mod template requires python."; exit 1; } @@ -14,15 +21,15 @@ command -v makensis >/dev/null 2>&1 || { echo >&2 "The OpenRA mod template requi PACKAGING_DIR=$(python -c "import os; print(os.path.dirname(os.path.realpath('$0')))") echo "Building Windows package" -${PACKAGING_DIR}/windows/buildpackage.sh "$1" "$2" +${PACKAGING_DIR}/windows/buildpackage.sh "${TAG}" "${OUTPUTDIR}" if [ $? -ne 0 ]; then - echo "Windows package build failed." + echo "Windows package build failed." fi echo "Building macOS package" -${PACKAGING_DIR}/osx/buildpackage.sh "$1" "$2" +${PACKAGING_DIR}/osx/buildpackage.sh "${TAG}" "${OUTPUTDIR}" if [ $? -ne 0 ]; then - echo "macOS package build failed." + echo "macOS package build failed." fi echo "Package build done." diff --git a/packaging/windows/buildpackage.sh b/packaging/windows/buildpackage.sh index 2bc4df5..05d3006 100755 --- a/packaging/windows/buildpackage.sh +++ b/packaging/windows/buildpackage.sh @@ -4,8 +4,8 @@ set -e command -v curl >/dev/null 2>&1 || { echo >&2 "Windows packaging requires curl."; exit 1; } command -v makensis >/dev/null 2>&1 || { echo >&2 "Windows packaging requires makensis."; exit 1; } -if [ $# -ne "2" ]; then - echo "Usage: `basename $0` tag outputdir" +if [ $# -eq "0" ]; then + echo "Usage: `basename $0` version [outputdir]" exit 1 fi @@ -27,7 +27,12 @@ if [ "${INCLUDE_DEFAULT_MODS}" = "True" ]; then fi TAG="$1" -OUTPUTDIR=$(python -c "import os; print(os.path.realpath('$2'))") +if [ $# -eq "1" ]; then + OUTPUTDIR=$(python -c "import os; print(os.path.realpath('.'))") +else + OUTPUTDIR=$(python -c "import os; print(os.path.realpath('$2'))") +fi + BUILTDIR="${PACKAGING_DIR}/build" # Set the working dir to the location of this script