From 1c1505c8050c3b09191c9666f2ec54591ae2803a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 29 Dec 2025 19:36:36 +0000 Subject: [PATCH] Optimize test script to avoid redundant busybox --list calls Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com> --- scripts/test.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/test.sh b/scripts/test.sh index 217c392..515a323 100644 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -23,12 +23,14 @@ if command -v busybox >/dev/null 2>&1; then fi echo "" echo "Available BusyBox applets (sample):" - busybox --list | head -n 20 - echo " ... and $(busybox --list | wc -l) total applets" + # Store applet list once to avoid redundant executions + APPLET_LIST=$(busybox --list) + echo "$APPLET_LIST" | head -n 20 + echo " ... and $(echo "$APPLET_LIST" | wc -l) total applets" echo "" echo "Networking applets (required for SparkOS):" for cmd in udhcpc ip ifconfig ping wget; do - if busybox --list | grep -q "^${cmd}$"; then + if echo "$APPLET_LIST" | grep -q "^${cmd}$"; then echo " ✓ $cmd" else echo " ✗ $cmd (NOT FOUND)"