From a0c42ec8a9237d042e1b6f3762465928541c782d Mon Sep 17 00:00:00 2001 From: Louis Abel Date: Mon, 1 Apr 2024 19:28:38 -0700 Subject: [PATCH] check for kiwi-ng using a builtin --- live-build.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/live-build.sh b/live-build.sh index e9b4286..7c0fd49 100755 --- a/live-build.sh +++ b/live-build.sh @@ -23,6 +23,10 @@ Options: OPTS=$(getopt -a -n live-build -o l:,o:,d,h \ -l live-image:,output-dir:,debug,help -- "$@") +function is_in_path() { + builtin type -P "${1}" +} + function usage() { echo "$__usage" } @@ -52,7 +56,10 @@ if [ -e "/sys/fs/selinux/enforce" ]; then fi fi -if [ ! -x "/usr/bin/kiwi-ng" ] || [ ! -x "$HOME/.local/bin/kiwi-ng" ]; then +is_in_path kiwi-ng &> /dev/null +ret_val=$? + +if [ "$ret_val" -ne "0" ]; then echo "kiwi-ng not found. kiwi packages are likely not installed on this system." exit 32 fi