diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2021-11-20 15:32:06 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2021-11-20 15:32:06 +0100 |
commit | 5fffaf89e4ed558fc7fe3bda4763409675bae071 (patch) | |
tree | ab9385bd5c562c0369c75cf66c59611d4e8906ed /tools | |
parent | 006964c4dc2fe26c5a16a3f7b5785fde926ff4ce (diff) | |
download | weechat-5fffaf89e4ed558fc7fe3bda4763409675bae071.zip |
build: improve error management in build of tarballs
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/makedist.sh | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/tools/makedist.sh b/tools/makedist.sh index 355583179..4f750d9af 100755 --- a/tools/makedist.sh +++ b/tools/makedist.sh @@ -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" |