fix: fix empty string if ustreamer not found (#253)

Signed-off-by: Patrick Gehrsitz <mryel00.github@gmail.com>
This commit is contained in:
Patrick Gehrsitz 2024-04-02 19:25:49 +02:00 committed by GitHub
parent a9db8f9ebe
commit 7f8536696f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -82,18 +82,15 @@ function check_dep {
function check_apps { function check_apps {
local cstreamer ustreamer local cstreamer ustreamer
ustreamer_base="bin/ustreamer" ustreamer="bin/ustreamer/src/ustreamer.bin"
ustreamer="$(find "${BASE_CN_PATH}"/"${ustreamer_base}" \
-iname 'ustreamer.bin' 2> /dev/null | sed '1q')"
cstreamer="bin/camera-streamer/camera-streamer" cstreamer="bin/camera-streamer/camera-streamer"
if [[ -x "${BASE_CN_PATH}/${ustreamer}" ]]; then
if [[ -x "${ustreamer}" ]]; then log_msg "Dependency: 'ustreamer' found in ${ustreamer}."
log_msg "Dependency: '${ustreamer##*/}' found in ${ustreamer_base}/${ustreamer##*/}." UST_BIN="${BASE_CN_PATH}/${ustreamer}"
UST_BIN="${ustreamer}"
# shellcheck disable=SC2034 # shellcheck disable=SC2034
declare -r UST_BIN declare -r UST_BIN
else else
log_msg "Dependency: '${ustreamer##*/}' not found. Exiting!" log_msg "Dependency: 'ustreamer' not found. Exiting!"
exit 1 exit 1
fi fi