make DEBUG an environment variable

This commit is contained in:
propruhh 2021-02-28 13:09:27 -06:00
parent df18da99e3
commit 9fe6aca8c2

View file

@ -2,23 +2,21 @@
tmpfile="$(mktemp nekofetchXXXXXXXX)"
debug=true
case "$1" in
"--nsfw"|"nsfw"|"-n"|"n")
if [ "$debug" = true ]; then
if [ "$DEBUG" = true ]; then
echo "Getting a nsfw image"
fi
imgurl="https://nekos.life/api/v2/img/cum_jpg"
;;
"--sfw"|"sfw"|"-s"|"s")
if [ "$debug" = true ]; then
if [ "$DEBUG" = true ]; then
echo "Getting a sfw image"
fi
imgurl="https://nekos.life/api/v2/img/neko"
;;
*)
if [ "$debug" = true ]; then
if [ "$DEBUG" = true ]; then
echo "Could not interpret as either sfw or nsfw. Defaulting to sfw."
fi
imgurl="https://nekos.life/api/v2/img/neko"
@ -26,7 +24,7 @@ case "$1" in
esac
echo "$2" | grep -qE '^[0-9]+$' && height="$2" || height="$(($(stty size | awk '{print $1}') - 5))"
if [ "$debug" = true ]; then
if [ "$DEBUG" = true ]; then
echo "Using height $height"
fi