1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-25 12:26:40 +02:00

build: improve error management in build of tarballs

This commit is contained in:
Sébastien Helleu
2021-11-20 15:32:06 +01:00
parent 006964c4dc
commit 5fffaf89e4
+12 -5
View File
@@ -33,12 +33,21 @@
# defaults to current directory
#
# exit on any error
set -e
error ()
{
echo >&2 "ERROR: $*"
exit 1
}
# check git repository
ROOT_DIR=$(git rev-parse --show-toplevel)
if [ -z "${ROOT_DIR}" ] || [ ! -d "${ROOT_DIR}/.git" ]; then
echo "This script must be run from WeeChat git repository."
exit 1
error "this script must be run from WeeChat git repository."
fi
cd "${ROOT_DIR}"
# default values
VERSION="$("${ROOT_DIR}/version.sh" devel-full)"
@@ -52,11 +61,9 @@ if [ $# -ge 2 ]; then
TREEISH=$2
fi
if [ $# -ge 3 ]; then
OUTPATH=$(cd "$3" || exit 1; pwd)
OUTPATH=$(cd "$3"; pwd)
fi
cd "${ROOT_DIR}" || exit 1
PREFIX="weechat-${VERSION}/"
FILE="${OUTPATH}/weechat-${VERSION}.tar"