From 03f142b99e7fdc191d3a08fe1da791344d5e0798 Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Sat, 30 Apr 2022 09:54:03 +0000 Subject: [PATCH] scripts/makefile_helper: make sure variables are set before running an rm --- scripts/makefile_helper | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/makefile_helper b/scripts/makefile_helper index dfcf40dd16..9184efffda 100755 --- a/scripts/makefile_helper +++ b/scripts/makefile_helper @@ -8,6 +8,11 @@ set -e # If config/options can't be sourced, abort. PWD isn't the expected ROOT. . config/options "" +if [ -z "${BUILD_BASE}" -o -z "${BUILD_ROOT}" ]; then + # make sure variables are set before running an rm + echo "error: ${0}: both BUILD_BASE and BUILD_ROOT must be set when running \"[clean|distclean]\"; aborting" + exit 1 +fi # task handling case $1 in --clean)