From 7ff9cf1d598fe9111f0f2ee3ec67003f333333d4 Mon Sep 17 00:00:00 2001 From: propruhh Date: Sun, 28 Feb 2021 13:16:42 -0600 Subject: [PATCH] Make debug messages oneline --- nekofetch | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/nekofetch b/nekofetch index c80bee2..9db1025 100755 --- a/nekofetch +++ b/nekofetch @@ -4,29 +4,21 @@ tmpfile="$(mktemp nekofetchXXXXXXXX)" case "$1" in "--nsfw"|"nsfw"|"-n"|"n") - if [ "$DEBUG" = true ]; then - echo "Getting a nsfw image" - fi + [ "$DEBUG" = "true" ] && echo "Getting a nsfw image" imgurl="https://nekos.life/api/v2/img/cum_jpg" ;; "--sfw"|"sfw"|"-s"|"s") - if [ "$DEBUG" = true ]; then - echo "Getting a sfw image" - fi + [ "$DEBUG" = "true" ] && echo "Getting a sfw image" imgurl="https://nekos.life/api/v2/img/neko" ;; *) - if [ "$DEBUG" = true ]; then - echo "Could not interpret as either sfw or nsfw. Defaulting to sfw." - fi + [ "$DEBUG" = "true" ] && echo "Could not interpret as either sfw or nsfw. Defaulting to sfw." imgurl="https://nekos.life/api/v2/img/neko" ;; esac echo "$2" | grep -qE '^[0-9]+$' && height="$2" || height="$(($(stty size | awk '{print $1}') - 5))" -if [ "$DEBUG" = true ]; then - echo "Using height $height" -fi +[ "$DEBUG" = "true" ] && echo "Using height $height" url=$(curl -fsSL "$imgurl" | jq -r ".url")