From fb8d0c86c44ba98cc770222edcb18f0a492aa37a Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 9 May 2024 14:31:43 +0100 Subject: build: exit if not running from lbmk directory there's no portable(posix) way to check when running from a symlink to lbmk in the current work directory for example: ln -s lbmk/build lbmktest ./lbmktest roms list this would pass the new test, and first try to include option.sh. in practise, the user probably doesn't happen to have include/option.sh in their current path i can use readlink here, but again not portable the current check will suffice. it also works when the symlink is called from $PATH e.g. /usr/bin/lbmktest exists and you do: lbmktest roms list Signed-off-by: Leah Rowe --- build | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'build') diff --git a/build b/build index 4c6a2916..59bd78d8 100755 --- a/build +++ b/build @@ -7,6 +7,11 @@ set -u -e +if [ "./${0##*/}" != "${0}" ]; then + printf "You must run this in the lbmk work directory.\n" 1>&2 + exit 1 +fi + . "include/option.sh" eval "$(setvars "" option aur_notice)" -- cgit v1.2.1