make directory-is-empty more robust

This commit is contained in:
Christian Winther 2024-01-26 20:45:56 +00:00 committed by Mehdi Benadel
parent f86fe41964
commit 89adbd0fd0
1 changed files with 1 additions and 1 deletions

View File

@ -326,7 +326,7 @@ function file-exists()
# @exitcode 1 If $1 does *NOT* contain files
function directory-is-empty()
{
[ -z "$(ls -A "${1}")" ]
path-exists "${1}" && [[ -z "$(ls -A "${1}")" ]]
}
# @description Ensures a directory exists (via mkdir)