Skip to content

Commit

Permalink
chore: fix clean_apps for installations without all backends (#230)
Browse files Browse the repository at this point in the history
If one of all the possible backends is not installed, `clean_apps` inside `build.sh` crashes.

Signed-off-by: Patrick Gehrsitz <mryel00.github@gmail.com>
  • Loading branch information
mryel00 authored Jan 13, 2024
1 parent 8b336ac commit f60f5d2
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions bin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
#### crowsnest - A webcam Service for multiple Cams and Stream Services.
####
#### Written by Stephan Wendel aka KwadFan <me@stephanwe.de>
#### Copyright 2021 - till today
#### Copyright 2021 - 2024
#### Co-authored by Patrick Gehrsitz aka mryel00 <mryel00.github@gmail.com>
#### Copyright 2024 - till today
#### https://github.com/mainsail-crew/crowsnest
####
#### This File is distributed under GPLv3
Expand Down Expand Up @@ -107,10 +109,10 @@ get_avail_mem() {
delete_apps() {
for path in "${ALL_PATHS[@]}"; do
if [[ ! -d "${path}" ]]; then
printf "'%s' does not exist! Delete skipped ...\n" "${path}"
printf "'%s' does not exist! Delete ... [SKIPPED]\n" "${path}"
fi
if [[ -d "${path}" ]]; then
printf "Deleting '%s' ... \n" "${path}"
printf "Deleting '%s' ... [DONE]\n" "${path}"
rm -rf "${path}"
fi
done
Expand All @@ -136,7 +138,7 @@ clone_cstreamer() {
[[ "$(is_pi5)" = "1" ]] ||
[[ "$(is_ubuntu_arm)" = "1" ]]; } &&
[[ "${CROWSNEST_UNATTENDED}" = "0" ]]; then
printf "WARN: Cloning camera-streamer skipped! Device is not supported!"
printf "Device is not supported! Cloning camera-streamer ... [SKIPPED]\n"
return
fi
if [[ -d "${BASE_CN_BIN_PATH}"/"${CSTREAMER_PATH}" ]]; then
Expand Down Expand Up @@ -166,10 +168,14 @@ clone_apps() {
### Run 'make clean' in cloned folders
clean_apps() {
for app in "${ALL_PATHS[@]}"; do
printf "\nRunning 'make clean' in %s ... \n" "${app}"
pushd "${app}" &> /dev/null || exit 1
make clean
popd &> /dev/null || exit 1
if [[ ! -d "${app}" ]]; then
printf "'%s' does not exist! Clean ... [SKIPPED]\n" "${app}"
else
printf "\nRunning 'make clean' in %s ... \n" "${app}"
pushd "${app}" &> /dev/null || exit 1
make clean
popd &> /dev/null || exit 1
fi
done
printf "\nRunning 'make clean' ... [DONE]\n"
}
Expand Down

0 comments on commit f60f5d2

Please sign in to comment.