From 3053e05ce4442fae18d21f0175a0b6b30982fa81 Mon Sep 17 00:00:00 2001 From: Tw93 Date: Wed, 17 Dec 2025 02:37:33 +0000 Subject: [PATCH] chore: auto format code --- lib/core/base.sh | 2 +- lib/core/ui.sh | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/core/base.sh b/lib/core/base.sh index 5b4e236..4555732 100644 --- a/lib/core/base.sh +++ b/lib/core/base.sh @@ -253,7 +253,7 @@ get_brand_name() { # Detect if system primary language is Chinese local is_chinese=false local sys_lang - sys_lang=$(defaults read -g AppleLanguages 2>/dev/null | grep -o 'zh-Hans\|zh-Hant\|zh' | head -1 || echo "") + sys_lang=$(defaults read -g AppleLanguages 2> /dev/null | grep -o 'zh-Hans\|zh-Hant\|zh' | head -1 || echo "") [[ -n "$sys_lang" ]] && is_chinese=true # Return localized names based on system language diff --git a/lib/core/ui.sh b/lib/core/ui.sh index b4bab88..9908444 100755 --- a/lib/core/ui.sh +++ b/lib/core/ui.sh @@ -49,7 +49,7 @@ for char in s: else: width += 1 print(width) -" "$str" 2>/dev/null && return +" "$str" 2> /dev/null && return fi # Fallback: Use wc with UTF-8 locale temporarily @@ -60,8 +60,8 @@ print(width) export LANG=en_US.UTF-8 local char_count byte_count width - char_count=$(printf '%s' "$str" | wc -m 2>/dev/null | tr -d ' ') - byte_count=$(printf '%s' "$str" | wc -c 2>/dev/null | tr -d ' ') + char_count=$(printf '%s' "$str" | wc -m 2> /dev/null | tr -d ' ') + byte_count=$(printf '%s' "$str" | wc -c 2> /dev/null | tr -d ' ') # Restore locale if [[ -n "$saved_lc_all" ]]; then @@ -127,7 +127,7 @@ for char in s: width += char_width print(result + '...') -" "$str" "$max_width" 2>/dev/null && return +" "$str" "$max_width" 2> /dev/null && return fi # Fallback: Use UTF-8 locale for proper string handling