handle when $1 not given

This commit is contained in:
Adithya 2023-05-13 00:32:03 +05:30
parent 4a1d5ade60
commit 516efdf34d
Signed by: adtya
GPG key ID: 48FC9915FFD326D0

6
packages/scripts/chpaper.sh Normal file → Executable file
View file

@ -2,7 +2,11 @@
set -eu
DIR="$1"
DIR="${1:-}"
if [ -z "$DIR" ]; then
echo "Usage: $0 <path to directory containing wallpapers>"
exit 1
fi
if [ ! -d "$DIR" ]; then
echo "$DIR: not a directory"
exit 1