test/system: Fix typos in conditional expressions
'[' is a command that's the same as 'test' and they might be implemented
as standalone executables or shell built-ins. Therefore, the negation
(ie., '!') has to cover the entire command to operate on its exit code.
Instead, if it's writtten as '[ ! ... ]', then the negation becomes an
argument to '[', which isn't the same thing.
Fallout from 54a2ca1ead
https://github.com/containers/toolbox/pull/1341
This commit is contained in:
parent
c846b6d844
commit
21299a3c5b
1 changed files with 2 additions and 2 deletions
|
@ -86,7 +86,7 @@ function _pull_and_cache_distro_image() {
|
|||
distro="$1"
|
||||
version="$2"
|
||||
|
||||
if [ ! -v IMAGES[$distro] ]; then
|
||||
if ! [ -v IMAGES[$distro] ]; then
|
||||
fail "Requested distro (${distro}) does not have a matching image"
|
||||
fi
|
||||
|
||||
|
@ -302,7 +302,7 @@ function pull_distro_image() {
|
|||
distro="$1"
|
||||
version="$2"
|
||||
|
||||
if [ ! -v IMAGES[$distro] ]; then
|
||||
if ! [ -v IMAGES[$distro] ]; then
|
||||
fail "Requested distro (${distro}) does not have a matching image"
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue