소스 검색

[F] Fix empty bracket displayed when no theme is present

https://github.com/dylanaraps/neofetch/pull/1713
Azalea (on HyDEV-Daisy) 2 년 전
부모
커밋
c52d9dca66
1개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 6 4
      neofetch

+ 6 - 4
neofetch

@@ -3751,10 +3751,12 @@ get_style() {
         append_theme "$gtk3_theme" 'GTK3'
 
         # Final string.
-        theme+=']'
-        theme="${theme#'], '}"
-        theme="${theme/'GTK2/GTK3'/'GTK2/3'}"
-        theme="${theme%, }"
+        if [[ -n "$theme" ]]; then
+          theme+=']'
+          theme="${theme#'], '}"
+          theme="${theme/'GTK2/GTK3'/'GTK2/3'}"
+          theme="${theme%, }"
+        fi
 
         # Make the output shorter by removing "[GTKX]" from the string.
         if [[ "$gtk_shorthand" == "on" ]]; then