mirror of
https://github.com/danbulant/nekofetch
synced 2026-06-10 18:13:17 +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
|
||||
case "$1" in
|
||||
"--nsfw"|"nsfw"|"-n"|"n")
|
||||
if [ "$imgtype" = "" ]; then
|
||||
if [ -z "$imgtype" ]; then
|
||||
[ "$DEBUG" = "true" ] && echo "Getting a nsfw image"
|
||||
imgtype="nsfw"
|
||||
else
|
||||
|
|
@ -15,7 +15,7 @@ while :; do
|
|||
fi
|
||||
;;
|
||||
"--sfw"|"sfw"|"-s"|"s")
|
||||
if [ "$imgtype" = "" ]; then
|
||||
if [ -z "$imgtype" ]; then
|
||||
[ "$DEBUG" = "true" ] && echo "Getting a sfw image"
|
||||
imgtype="sfw"
|
||||
else
|
||||
|
|
@ -27,7 +27,7 @@ while :; do
|
|||
use_w3m="true"
|
||||
;;
|
||||
"--height"|"-h")
|
||||
if [ "$use_height" = "" ]; then
|
||||
if [ -z "$use_height" ]; then
|
||||
use_height="$2"
|
||||
[ "$DEBUG" = "true" ] && echo "Using height $height"
|
||||
else
|
||||
|
|
@ -51,7 +51,7 @@ else
|
|||
imgurl="https://nekos.life/api/v2/img/neko"
|
||||
fi
|
||||
|
||||
if [ "$use_height" != "" ]; then
|
||||
if [ ! -z "$use_height" ]; then
|
||||
height="$use_height"
|
||||
else
|
||||
height="$(($(stty size | awk '{print $1}') - 5))"
|
||||
|
|
|
|||
Loading…
Reference in a new issue