sh: Fix meaningless unquoted expansion

[[ ${VALUE} ]] means "expand the VALUE variable, splitting on spaces,
and pass those words as arguments to [[…]]". So if VALUE was the string
'-n blah' then that would expand to '[[ -n blah ]]' which is meaningful
but not at all what was intended.

Instead it appears this intented to check for a non-empty string.
This commit is contained in:
Robert Estelle 2020-07-29 11:27:54 -07:00 committed by Ferran Basora
parent 16a1ac9cf5
commit a0548965f8

View File

@ -15,7 +15,7 @@ function add-boolean-param {
function add-option-param {
VALUE=$(tmux show -vg @thumbs-$1 2> /dev/null)
if [[ ${VALUE} ]]; then
if [ -n "${VALUE}" ]; then
PARAMS+=("--$1=${VALUE}")
fi
}