From 97e6fa25ed5a22bb20f8e9e259806529cd90d94b Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 8 Jun 2026 12:40:52 +0000 Subject: [PATCH 1/2] tools: change fbq-add-source.sh quit option from 4 to 0 https://claude.ai/code/session_014CCYqVwW6d6f5dw1qRokYt --- tools/fbq-add-source.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/fbq-add-source.sh b/tools/fbq-add-source.sh index 6d08b50..6a40c9c 100644 --- a/tools/fbq-add-source.sh +++ b/tools/fbq-add-source.sh @@ -309,7 +309,7 @@ main() { echo " 1) Add source(s)" echo " 2) Remove a source" echo " 3) Show current sources" - echo " 4) Quit" + echo " 0) Quit" echo "" read -r -p " Choice [1]: " action action="${action:-1}" @@ -319,7 +319,7 @@ main() { 1) cmd_add "$install_dir" "$config" "$data_mount" ;; 2) cmd_remove "$install_dir" "$config" ;; 3) cmd_show "$config" ;; - 4|q|Q) break ;; + 0|q|Q) break ;; *) warn "Invalid choice." ;; esac echo "" From 838af715aa75e48c60c6ba9b52ef3a14ac155dce Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 8 Jun 2026 12:43:42 +0000 Subject: [PATCH 2/2] tools: fix fbq-add-source.sh exiting after first source with set -e (( n++ )) returns exit code 1 when the pre-increment value is 0, which kills the script under set -euo pipefail. Replace with n=$(( n + 1 )) which always returns 0. https://claude.ai/code/session_014CCYqVwW6d6f5dw1qRokYt --- tools/fbq-add-source.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/fbq-add-source.sh b/tools/fbq-add-source.sh index 6a40c9c..ce044bb 100644 --- a/tools/fbq-add-source.sh +++ b/tools/fbq-add-source.sh @@ -228,7 +228,7 @@ cmd_remove() { local name name=$(yq e ".server.sources[] | select(.path == \"$p\") | .name // \"(unnamed)\"" "$config" 2>/dev/null || echo "(unnamed)") printf " %2d) %-20s %s\n" "$i" "${name:-?}" "$p" - (( i++ )) + i=$(( i + 1 )) done echo "" @@ -268,7 +268,7 @@ cmd_show() { ro=$(yq e ".server.sources[] | select(.path == \"$p\") | .config.readOnly // false" "$config" 2>/dev/null || echo "false") printf " %-20s %-35s defaultEnabled=%-5s readOnly=%s\n" \ "${name}" "${p}" "${enabled}" "${ro}" - (( count++ )) + count=$(( count + 1 )) done < <(list_sources "$config") [[ "$count" -eq 0 ]] && warn "No sources found."