dir-empty: Check if directories are empty

master
neingeist 2 years ago
parent 258f472f06
commit 65a2002323

@ -0,0 +1,10 @@
#!/bin/sh
# Check that all of the given directories are empty
for d in "$@"; do
if [[ -n "$(ls -1 "$d")" ]]; then
exit 1
fi
done
exit 0
Loading…
Cancel
Save