From 4bca7849feb22e107818434886b477f5b431836e Mon Sep 17 00:00:00 2001 From: Fini Jastrow Date: Wed, 12 Oct 2022 10:01:06 +0200 Subject: [PATCH] gotta-patch-em-all: Fix config_has_powerline [why] There is code that shall read the config file and act on config_has_powerline. Usually it is set to "1", but Ubuntu has this "0". Regardless the content, if the variable has content the code assumes the value is true. That is probably not wanted. [how] Use a numeric comparison. [note] ``` git blame UbuntuMono/config.cfg 4abe6c77b0 Ubuntu/Bold-Italic/config.cfg (Ryan L McIntyre 2017-07-23 17:17:21 -0400 1) config_has_powerline=0 ``` Signed-off-by: Fini Jastrow --- bin/scripts/gotta-patch-em-all-font-patcher!.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/scripts/gotta-patch-em-all-font-patcher!.sh b/bin/scripts/gotta-patch-em-all-font-patcher!.sh index 412755f57..9a23d9cef 100755 --- a/bin/scripts/gotta-patch-em-all-font-patcher!.sh +++ b/bin/scripts/gotta-patch-em-all-font-patcher!.sh @@ -127,7 +127,7 @@ function patch_font { # shellcheck disable=SC2154 # we know the '$config_has_powerline' is from the sourced file - if [ "$config_has_powerline" ] + if [ "$config_has_powerline" -gt 0 ] then powerline="" combinations=$(printf "./font-patcher ${f##*/} %s\\n" {' --use-single-width-glyphs',}{' --windows',}{' --fontawesome',}{' --octicons',}{' --fontlogos',}{' --pomicons',}{' --powerlineextra',}{' --fontawesomeextension',}{' --powersymbols',}{' --weather',}{' --material',}) @@ -193,7 +193,7 @@ function generate_info { source "$config_parent_dir/config.cfg" fi - if [ "$config_has_powerline" ] + if [ "$config_has_powerline" -gt 0 ] then powerline="" combinations=$(printf "./font-patcher ${f##*/} %s\\n" {' --use-single-width-glyphs',}{' --windows',}{' --fontawesome',}{' --octicons',}{' --fontlogos',}{' --pomicons',}{' --powerlineextra',}{' --fontawesomeextension',}{' --powersymbols',}{' --weather',}{' --material',})