Fixes double negative expressions

ShellCheck rule SC2236
This commit is contained in:
Ryan L McIntyre 2019-08-11 00:13:55 -07:00
parent 5fc19901f3
commit 5d5c1b449e

View file

@ -138,10 +138,10 @@ nerdfonts_root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/patched-fonts"
nerdfonts_dirs=("$nerdfonts_root_dir")
# Accept font / directory names, to avoid installing all fonts
if [ ! -z "$*" ]; then
if [ -n "$*" ]; then
nerdfonts_dirs=()
for font in "${@}"; do
if [ ! -z "$font" ]; then
if [ -n "$font" ]; then
# Ensure that directory exists, and offer suggestions if not
if [[ ! -d "$nerdfonts_root_dir/$font" ]]; then
echo -e "Font $font doesn't exist. Options are: \\n"
@ -169,17 +169,17 @@ find_exclude=
# If we have patches or compat, define what to include
include=()
if [ ! -z "${patches[*]}" ]; then
if [ -n "${patches[*]}" ]; then
include=( "${include[@]}" "${patches[@]}" )
fi
if [ ! -z "${compat[*]}" ]; then
if [ -n "${compat[*]}" ]; then
include=( "${include[@]}" "${compat[@]}" )
fi
# Delete empty elements
for i in "${!include[@]}"; do
[ "${include[$i]}" = '' ] && unset include["$i"]
done
if [ ! -z "${include[*]}" ]; then
if [ -n "${include[*]}" ]; then
implode find_include "*' -and -name '*" "${include[@]}"
find_include="-and -name '*${find_include}*'"
fi
@ -193,7 +193,7 @@ done
for i in "${!exclude[@]}"; do
[ "${exclude[$i]}" = '' ] && unset exclude["$i"]
done
if [ ! -z "${exclude[*]}" ]; then
if [ -n "${exclude[*]}" ]; then
implode find_exclude "*' -and \\! -name '*" "${exclude[@]}"
find_exclude="-and \\! -name '*${find_exclude}*'"
fi