Fix SonarCloud code smells in netbird-macos.sh

- emit_string: add an explicit default case (`*)`) to the key case.
- is_bool: assign the positional parameter to a local variable before
  matching it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MUdj7EhXdGMd953nHoBUTD
This commit is contained in:
mlsmaycon
2026-08-27 11:47:53 +00:00
parent 32d1546d00
commit e52a076ab9

View File

@@ -118,13 +118,15 @@ emit_string() {
printf ' <key>%s</key>\n <string>%s</string>\n' "$key" "$escaped" >> "$PLIST_PATH.tmp"
case "$key" in
preSharedKey|debugBundleUploadURL) log_value='********** (secret)' ;;
*) ;;
esac
log "set $key = $log_value"
}
# is_bool returns success if the value is an accepted boolean token.
is_bool() {
case "$1" in
local value="$1"
case "$value" in
true|True|TRUE|1|yes|false|False|FALSE|0|no) return 0 ;;
*) return 1 ;;
esac