From 628e91a3b9a98a08000c14fc8cea1353889458f7 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 9 May 2024 14:48:14 +0100 Subject: [PATCH] build: further prevent non-cbmk-work-directory this is a follow-up to the previous commit again, there's no posix way to check the path to the file at argument 0, because readlink (utility) isn't defined in posix (the C function is defined, but not the utility included on many unices) check whether "build" (file) exists, and whether it is a symlink; if the latter, then we are definitely not in the cbmk work directory! Signed-off-by: Leah Rowe --- build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build b/build index 3ad6bbd..e0dbff7 100755 --- a/build +++ b/build @@ -7,7 +7,7 @@ set -u -e -if [ "./${0##*/}" != "${0}" ]; then +if [ "./${0##*/}" != "${0}" ] || [ ! -f "build" ] || [ -L "build" ]; then printf "You must run this in the cbmk work directory.\n" 1>&2 exit 1 fi