Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some outputs should error 1 not error 0 #572

Closed
wants to merge 1 commit into from

Conversation

cdrage
Copy link
Member

@cdrage cdrage commented Jul 9, 2018

fmt.Printf errors out with checkout code 0. However, there are some
prompts (this component doens't exist, this application doesn't exist)
that error out with 0, they should error with checkout code 1 (using
fmt.Errorf).

This creates incorrect output for PS1 / odo utils terminal code as it
creates scenarios where there is a false error code output:

if [ $? != 0 ]; then
  APP="Unable to retrieve app"
else
  APP=$(echo $APP_GET | sed "s/The current application is: //g")
fi

fmt.Printf errors out with checkout code 0. However, there are some
prompts (this component doens't exist, this application doesn't exist)
that error out with 0, they should error with checkout code 1 (using
fmt.Errorf).

This creates incorrect output for PS1 / `odo utils terminal` code as it
creates scenarios where there is a false error code output:

```sh
if [ $? != 0 ]; then
  APP="Unable to retrieve app"
else
  APP=$(echo $APP_GET | sed "s/The current application is: //g")
fi
```
@cdrage cdrage mentioned this pull request Jul 9, 2018
@cdrage
Copy link
Member Author

cdrage commented Jul 10, 2018

After discussion in #549 I'm going to close this (for now), but I'll still keep this branch just-in-case for reference.

@cdrage cdrage closed this Jul 10, 2018
@cdrage cdrage deleted the fix-ps1 branch January 14, 2022 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant