Update: dmenumount -Make empty string check more consistent (#955)

* Make empty string check more consistent

Replace explicit empty string check condition with inbuilt  POSIX compliant empty string check flag, in adherence with the rest of the script.

* Update test expression
This commit is contained in:
7ze 2021-05-31 06:32:36 +05:30 committed by GitHub
parent 76f7656cb2
commit 1e957b7f90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,7 +9,7 @@ getmount() { \
[ -z "$chosen" ] && exit 1 [ -z "$chosen" ] && exit 1
# shellcheck disable=SC2086 # shellcheck disable=SC2086
mp="$(find $1 2>/dev/null | dmenu -i -p "Type in mount point.")" || exit 1 mp="$(find $1 2>/dev/null | dmenu -i -p "Type in mount point.")" || exit 1
[ "$mp" = "" ] && exit 1 test -z "$mp" && exit 1
if [ ! -d "$mp" ]; then if [ ! -d "$mp" ]; then
mkdiryn=$(printf "No\\nYes" | dmenu -i -p "$mp does not exist. Create it?") || exit 1 mkdiryn=$(printf "No\\nYes" | dmenu -i -p "$mp does not exist. Create it?") || exit 1
[ "$mkdiryn" = "Yes" ] && (mkdir -p "$mp" || sudo -A mkdir -p "$mp") [ "$mkdiryn" = "Yes" ] && (mkdir -p "$mp" || sudo -A mkdir -p "$mp")