excludelist: Return empty string if something goes wrong

Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
This commit is contained in:
Patrick José Pereira
2018-04-09 20:49:58 -03:00
parent 88aba55163
commit 7b7f603278
+6
View File
@@ -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'\\" << '