Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove exit in favor of return statements #49

Merged
merged 1 commit into from
Feb 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions launch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,7 @@ network_loop() {
show_message "Connecting to $SSID..." forever
if ! wifi_on; then
show_message "Failed to start wifi!" 2
killall sdl2imgshow >/dev/null 2>&1 || true
exit 1
return 1
fi
break
done
Expand All @@ -410,16 +409,16 @@ main() {
allowed_platforms="tg5040 rg35xxplus"
if ! echo "$allowed_platforms" | grep -q "$PLATFORM"; then
show_message "$PLATFORM is not a supported platform" 2
exit 1
return 1
fi

if [ ! -f "$progdir/bin/minui-keyboard-$PLATFORM" ]; then
show_message "$progdir/bin/minui-keyboard-$PLATFORM not found" 2
exit 1
return 1
fi
if [ ! -f "$progdir/bin/minui-list-$PLATFORM" ]; then
show_message "$progdir/bin/minui-list-$PLATFORM not found" 2
exit 1
return 1
fi

chmod +x "$progdir/bin/minui-keyboard-$PLATFORM"
Expand All @@ -431,7 +430,7 @@ main() {
RGXX_MODEL="$(strings /mnt/vendor/bin/dmenu.bin | grep ^RG)"
if [ "$RGXX_MODEL" = "RG28xx" ]; then
show_message "Wifi not supported on RG28XX" 2
exit 1
return 1
fi
fi

Expand Down Expand Up @@ -459,8 +458,7 @@ main() {
show_message "Disconnecting from wifi..." forever
if ! wifi_off; then
show_message "Failed to stop wifi!" 2
killall sdl2imgshow >/dev/null 2>&1 || true
exit 1
return 1
fi
show_message "Refreshing connection..." forever
if ! "$progdir/bin/wifi-enable"; then
Expand All @@ -472,8 +470,7 @@ main() {
show_message "Disconnecting from wifi..." forever
if ! wifi_off; then
show_message "Failed to stop wifi!" 2
killall sdl2imgshow >/dev/null 2>&1 || true
exit 1
return 1
fi
elif echo "$selection" | grep -q "^Toggle start on boot$"; then
if will_start_on_boot; then
Expand Down