I'm trying to write a bash script that validates that composer.lock is up to date with composer.json before attempting to run `composer install`.

I have tried something like this:

```
if composer validate --no-check-all
  then echo "Composer validation failed..."
  exit 1;
fi

# composer install

```

That does exit my script on validation errors, however when validation passes I still get the following output:

```
./composer.json is valid
Composer validation failed...

```

What am I doing wrong here?

Edit: The test statement in the if block is missing a negation as correctly pointed out by Jeff Schaller. It doesn't affect the question much (since the exit code from composer validate is the same). I'm leaving the original wording as to not introduce further confusion.