From b1ffe0edd5fe07c90b00d99113e899701cab9046 Mon Sep 17 00:00:00 2001 From: Unrud Date: Fri, 21 Oct 2022 15:45:19 +0200 Subject: [PATCH] Don't use parameter expansion for paths It fails when the script is started with `bash package-all.sh`. --- packaging/package-all.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packaging/package-all.sh b/packaging/package-all.sh index 976cf0e612..8df9d297a0 100755 --- a/packaging/package-all.sh +++ b/packaging/package-all.sh @@ -4,15 +4,16 @@ set -o errexit -o pipefail || exit $? if [ $# -ne "2" ]; then - echo "Usage: ${0##*/} version outputdir." + echo "Usage: $(basename "$0") version outputdir." exit 1 fi export GIT_TAG="$1" export BUILD_OUTPUT_DIR="$2" -# Set the working dir to the location of this script using bash parameter expansion -cd "${0%/*}" +# Set the working dir to the location of this script +HERE=$(dirname "$0") +cd "${HERE}" #build packages using a subshell so directory changes do not persist beyond the function function build_package() (