build: further prevent non-lbmk-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 lbmk work directory!

Signed-off-by: Leah Rowe <leah@libreboot.org>
20240612_branch
Leah Rowe 2024-05-09 14:48:14 +01:00
parent fb8d0c86c4
commit 052414c0ca
1 changed files with 1 additions and 1 deletions

2
build
View File

@ -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 lbmk work directory.\n" 1>&2
exit 1
fi