check for kiwi-ng using a builtin

This commit is contained in:
Louis Abel 2024-04-01 19:28:38 -07:00
parent 18d5841f3b
commit a0c42ec8a9
Signed by: label
GPG Key ID: 2A6975660E424560

View File

@ -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