aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Mortier <mort@cantab.net>2019-03-01 16:55:42 +0000
committerRichard Mortier <mort@cantab.net>2019-03-01 16:55:42 +0000
commitd6457141fa1cccb24ac8a1bfa35a143265ba7aeb (patch)
tree8c0299ab239b85c7c953d5ee8268bf7e269bd53b
parent4587485cf534510b850acdf2bbae3b834b29f10e (diff)
downloaddocker-abuild-d6457141fa1cccb24ac8a1bfa35a143265ba7aeb.tar.bz2
docker-abuild-d6457141fa1cccb24ac8a1bfa35a143265ba7aeb.tar.xz
abuild: slightly more defensive
Signed-off-by: Richard Mortier <mort@cantab.net>
-rwxr-xr-xabuild8
1 files changed, 7 insertions, 1 deletions
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