#!/bin/bash set -e # download excludelist blacklisted=($(wget --quiet https://raw.githubusercontent.com/probonopd/AppImages/master/excludelist -O - | sort | uniq | grep -v "^#.*" | grep "[^-\s]")) # sanity check if [ "$blacklisted" == "" ]; then exit 1; fi filename=$(readlink -f $(dirname "$0"))/linuxdeployqt/excludelist.h # overwrite existing source file cat > "$filename" < static const QStringList generatedExcludelist = { EOF # Create array for item in ${blacklisted[@]:0:${#blacklisted[@]}-1}; do echo -e ' "'"$item"'",' >> "$filename" done echo -e ' "'"${blacklisted[-1]}"'"' >> "$filename" echo "};" >> "$filename"