From 84ff076b41033daf5ceab70acdb6a297534cf7a5 Mon Sep 17 00:00:00 2001 From: Seppia Date: Mon, 11 Jun 2018 13:52:12 +0200 Subject: List bug fix Fixes a bug that happens when listing local packages and no packages are present in local path. It now prints a waring, saying that no local package is present. --- repofish | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/repofish b/repofish index 8835a2d..3007e51 100755 --- a/repofish +++ b/repofish @@ -56,8 +56,12 @@ check_package() { } list_packages() { - echo -e '\033[1;34m:: \033[1;37mPackages locally available:\033[m' - find ${SRC_PATH}/* -type d -prune | awk -F '/' '{print $NF}' + if [ -z "$(ls -A ${SRC_PATH})" ]; then + echo -e '\033[1;34m:: \033[1;37mNo packages are locally available!\033[m' + else + echo -e '\033[1;34m:: \033[1;37mPackages locally available:\033[m' + find ${SRC_PATH}/* -type d -prune | awk -F '/' '{print $NF}' + fi } clean_packages() { -- cgit v1.2.3