From cca4cdc4f1549e652da1f9688c260f8d5a646c6c Mon Sep 17 00:00:00 2001 From: a1346054 <36859588+a1346054@users.noreply.github.com> Date: Sat, 14 Aug 2021 11:33:22 +0000 Subject: [PATCH] improve test logic and be explicit about the test --- uninstall | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/uninstall b/uninstall index 21744ab..094d689 100755 --- a/uninstall +++ b/uninstall @@ -104,10 +104,10 @@ if [ -d "${fish_dir}/functions" ]; then remove "${fish_dir}/functions/fzf.fish" remove "${fish_dir}/functions/fzf_key_bindings.fish" - if [ "$(ls -A "${fish_dir}/functions")" ]; then - echo "Can't delete non-empty directory: \"${fish_dir}/functions\"" - else + if [ -z "$(ls -A "${fish_dir}/functions")" ]; then rmdir "${fish_dir}/functions" + else + echo "Can't delete non-empty directory: \"${fish_dir}/functions\"" fi fi