mirror of
https://github.com/danbulant/nekofetch
synced 2026-06-24 17:11:49 +00:00
Use -z instead of checking if equal to ""
This commit is contained in:
parent
baac624468
commit
edfc35ce34
1 changed files with 4 additions and 4 deletions
|
|
@ -7,7 +7,7 @@ use_height=""
|
||||||
while :; do
|
while :; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
"--nsfw"|"nsfw"|"-n"|"n")
|
"--nsfw"|"nsfw"|"-n"|"n")
|
||||||
if [ "$imgtype" = "" ]; then
|
if [ -z "$imgtype" ]; then
|
||||||
[ "$DEBUG" = "true" ] && echo "Getting a nsfw image"
|
[ "$DEBUG" = "true" ] && echo "Getting a nsfw image"
|
||||||
imgtype="nsfw"
|
imgtype="nsfw"
|
||||||
else
|
else
|
||||||
|
|
@ -15,7 +15,7 @@ while :; do
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
"--sfw"|"sfw"|"-s"|"s")
|
"--sfw"|"sfw"|"-s"|"s")
|
||||||
if [ "$imgtype" = "" ]; then
|
if [ -z "$imgtype" ]; then
|
||||||
[ "$DEBUG" = "true" ] && echo "Getting a sfw image"
|
[ "$DEBUG" = "true" ] && echo "Getting a sfw image"
|
||||||
imgtype="sfw"
|
imgtype="sfw"
|
||||||
else
|
else
|
||||||
|
|
@ -27,7 +27,7 @@ while :; do
|
||||||
use_w3m="true"
|
use_w3m="true"
|
||||||
;;
|
;;
|
||||||
"--height"|"-h")
|
"--height"|"-h")
|
||||||
if [ "$use_height" = "" ]; then
|
if [ -z "$use_height" ]; then
|
||||||
use_height="$2"
|
use_height="$2"
|
||||||
[ "$DEBUG" = "true" ] && echo "Using height $height"
|
[ "$DEBUG" = "true" ] && echo "Using height $height"
|
||||||
else
|
else
|
||||||
|
|
@ -51,7 +51,7 @@ else
|
||||||
imgurl="https://nekos.life/api/v2/img/neko"
|
imgurl="https://nekos.life/api/v2/img/neko"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$use_height" != "" ]; then
|
if [ ! -z "$use_height" ]; then
|
||||||
height="$use_height"
|
height="$use_height"
|
||||||
else
|
else
|
||||||
height="$(($(stty size | awk '{print $1}') - 5))"
|
height="$(($(stty size | awk '{print $1}') - 5))"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue