From d6457141fa1cccb24ac8a1bfa35a143265ba7aeb Mon Sep 17 00:00:00 2001 From: Richard Mortier Date: Fri, 1 Mar 2019 16:55:42 +0000 Subject: abuild: slightly more defensive Signed-off-by: Richard Mortier --- abuild | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'abuild') diff --git a/abuild b/abuild index 855cdbc..f8e0c84 100755 --- a/abuild +++ b/abuild @@ -3,11 +3,17 @@ set -e ## debug -if [[ "$DOCKER_ABUILD_DEBUG" = "true" ]]; then +if [ "$DOCKER_ABUILD_DEBUG" = "true" ]; then set -x PS4='$LINENO: ' fi +if [ "${PWD%aports/*}" = "$PWD" ]; then + echo "Error: expecting to be run from within an aports/ tree!" + echo "Could not find 'aports/' in the current path ($PWD)" + exit 1 +fi + DOCKER_VOLUMES=" -v $PWD:/cwd -v ${HOME}/.abuild:/home/builder/.abuild -- cgit v1.2.3