From 7b7f603278d1f64b18457e7537a83fc3c38f8ebd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Mon, 9 Apr 2018 20:49:58 -0300 Subject: [PATCH] excludelist: Return empty string if something goes wrong MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- tools/excludelist.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/excludelist.sh b/tools/excludelist.sh index dce1a11..bd2ecb2 100755 --- a/tools/excludelist.sh +++ b/tools/excludelist.sh @@ -2,6 +2,12 @@ # Download excludelist blacklisted=($(wget --quiet https://raw.githubusercontent.com/probonopd/AppImages/master/excludelist -O - | sort | uniq | grep -v "^#.*" | grep "[^-\s]")) +if [ -z $blacklisted ]; then + # Return nothing if no output from command + echo "" + exit +fi + # Create array for item in ${blacklisted[@]:0:${#blacklisted[@]}-1}; do echo -ne '\\"'$item'\\" << '