mirror of
https://github.com/FliegendeWurst/tmux-thumbs.git
synced 2024-11-22 21:05:00 +00:00
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:
parent
16a1ac9cf5
commit
a0548965f8
@ -15,7 +15,7 @@ function add-boolean-param {
|
|||||||
function add-option-param {
|
function add-option-param {
|
||||||
VALUE=$(tmux show -vg @thumbs-$1 2> /dev/null)
|
VALUE=$(tmux show -vg @thumbs-$1 2> /dev/null)
|
||||||
|
|
||||||
if [[ ${VALUE} ]]; then
|
if [ -n "${VALUE}" ]; then
|
||||||
PARAMS+=("--$1=${VALUE}")
|
PARAMS+=("--$1=${VALUE}")
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user