You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Quote variables to prevent word splitting (SC2086)
- Check exit code directly instead of using $? (SC2181)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: nerd-font-manager.sh
+8-10Lines changed: 8 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -128,7 +128,7 @@ cli_mode() {
128
128
129
129
# Add [ALL] option and enable search with header hint
130
130
local SELECTED
131
-
SELECTED=$(printf "[ALL] Install all fonts\n%s\n"$FONTS| fzf --multi --prompt="Install (type to filter) > " --header="Select fonts (TAB to multi-select, ENTER to confirm)")
131
+
SELECTED=$(echo -e "[ALL] Install all fonts\n$FONTS"| fzf --multi --prompt="Install (type to filter) > " --header="Select fonts (TAB to multi-select, ENTER to confirm)")
132
132
133
133
if [ -z"$SELECTED" ];then
134
134
echo"Nothing selected."
@@ -140,7 +140,7 @@ cli_mode() {
140
140
echo"Installing ALL available Nerd Fonts..."
141
141
mapfile -t names <<<"$FONTS"
142
142
else
143
-
mapfile -t names <<<"$(printf "%s\n"$SELECTED)"
143
+
mapfile -t names <<<"$SELECTED"
144
144
fi
145
145
install_fonts_by_middle_names "${names[@]}"
146
146
;;
@@ -156,7 +156,7 @@ cli_mode() {
156
156
157
157
# Add [ALL] option and enable search with header hint
158
158
local SELECTED
159
-
SELECTED=$(printf "[ALL] Uninstall all fonts\n%s\n"$FONTS| fzf --multi --prompt="Uninstall (type to filter) > " --header="Select fonts (TAB to multi-select, ENTER to confirm)")
159
+
SELECTED=$(echo -e "[ALL] Uninstall all fonts\n$FONTS"| fzf --multi --prompt="Uninstall (type to filter) > " --header="Select fonts (TAB to multi-select, ENTER to confirm)")
160
160
161
161
if [ -z"$SELECTED" ];then
162
162
echo"Nothing selected."
@@ -168,7 +168,7 @@ cli_mode() {
168
168
echo"Uninstalling ALL installed Nerd Fonts..."
169
169
mapfile -t names <<<"$FONTS"
170
170
else
171
-
mapfile -t names <<<"$(printf "%s\n"$SELECTED)"
171
+
mapfile -t names <<<"$SELECTED"
172
172
fi
173
173
uninstall_fonts_by_middle_names "${names[@]}"
174
174
;;
@@ -220,12 +220,11 @@ gui_mode() {
220
220
221
221
# Optional search filter
222
222
local SEARCH
223
-
SEARCH=$(osascript <<EOF
223
+
if!SEARCH=$(osascript <<EOF
224
224
display dialog "Enter search term (leave empty for all fonts):" default answer "" with title "Filter Fonts" buttons {"Cancel", "Search"} default button "Search"
225
225
text returned of result
226
226
EOF
227
-
)
228
-
if [ $?-ne 0 ];then
227
+
);then
229
228
exit 0
230
229
fi
231
230
@@ -276,12 +275,11 @@ EOF
276
275
277
276
# Optional search filter
278
277
local SEARCH
279
-
SEARCH=$(osascript <<EOF
278
+
if!SEARCH=$(osascript <<EOF
280
279
display dialog "Enter search term (leave empty for all fonts):" default answer "" with title "Filter Fonts" buttons {"Cancel", "Search"} default button "Search"
0 commit comments