Default packaging output to current working directory.

This commit is contained in:
Paul Chote 2017-08-24 22:15:21 +01:00
parent fac25a869f
commit 701e10b87f
3 changed files with 30 additions and 13 deletions

View File

@ -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"

View File

@ -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."

View File

@ -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