X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/xdg-ninja.git/blobdiff_plain/f7d4d8fe3eca997fbf96b75e66db6e78e3e7ad49..4e9316b332eaa0ed5832a1246878dd6b015cb038:/xdg-ninja.sh diff --git a/xdg-ninja.sh b/xdg-ninja.sh index 698ee67..94a8969 100755 --- a/xdg-ninja.sh +++ b/xdg-ninja.sh @@ -98,8 +98,10 @@ check_if_file_exists() { } decode_string() { - printf "%s\n" "$1" | sed -e 's/\\n/\ -/g' -e 's/\\\"/\"/g' # Replace \n with literal newline and \" with " + printf "%s" "$1" | sed -e 's/\\n/\ +/g' -e 's/\\\"/\"/g' -e '$ s/\n*$/\ +\ +/' # Replace \n with literal newline and \" with ", normalize number of trailing newlines to 2 } # Function to handle the formatting of output @@ -162,7 +164,7 @@ check_file() { else log WARN "$NAME" "$FILENAME" "$HELP" fi - if [ "$HELP" = true ]; then + if [ "$HELP" ]; then log HELP "$NAME" "$FILENAME" "$HELP" else log HELP "$NAME" "$FILENAME" "_No help available._"