✨ dir-empty: Check if directories are empty
This commit is contained in:
parent
258f472f06
commit
65a2002323
1 changed files with 10 additions and 0 deletions
10
dir-empty
Executable file
10
dir-empty
Executable file
|
@ -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…
Add table
Add a link
Reference in a new issue