Automattic / Automattic/vip-cli

VIP does not return a proper response code

Open
#599 3 comments 0 reactions 0 assignees View on GitHub
[Status] Keep
Dominant language
Go
Stars
64
Forks
21
Avg merge
2d 1h
Merged PRs (30d)
21

Description

## Expected/Desired Behavior

The status code returned by wp should be properly set, this helps with command chaining or handling failures.

```
$ wp ajsodjasiodjsaiod
Error: 'ajsodjasiodjsaiod' is not a registered wp command. See 'wp help' for available commands.

$ echo $?
1

$ vip @app.env wp ajsodjasiodjsaiod
Error: 'ajsodjasiodjsaiod' is not a registered wp command. See 'wp help' for available commands.

$ echo $?
1
```

## Actual Behavior

```
$ wp ajsodjasiodjsaiod
Error: 'ajsodjasiodjsaiod' is not a registered wp command. See 'wp help' for available commands.

$ echo $?
1

$ vip @app.env wp ajsodjasiodjsaiod
Error: 'ajsodjasiodjsaiod' is not a registered wp command. See 'wp help' for available commands.

$ echo $?
0
```

## Steps to Reproduce the Problem

1. Step 1: Run a `vip @app.env wp` command that throws an error or otherwise returns an error status code through standard WP CLI.
1. Step 2: Check the returned status code, and notice it is always "0".

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.