summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/dir.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/dir.sh b/src/dir.sh
index 979ac53..6297c2c 100644
--- a/src/dir.sh
+++ b/src/dir.sh
@@ -65,10 +65,12 @@ try_rmdir()
{
local dir="${1}"
- if dir_is_empty "${dir}"; then
- rmdir "${dir}"
- return ${?}
- else
+ if ! dir_is_empty "${dir}"; then
+ return 1
+ fi
+ if ! rmdir "${dir}"; then
return 1
fi
+
+ return 0
}