Improve user message when pulumi plugin rm --all has no plugins to remove (#5547)

Fixes: #5376

```                                                                                                                                                                                          ⍉
pulumi plugin rm --all --yes
no plugins found to uninstall
echo $?
0
```
This commit is contained in:
Paul Stack 2020-10-12 18:31:55 +01:00 committed by GitHub
parent cd518c3516
commit 38152ba6f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View file

@ -41,6 +41,10 @@ CHANGELOG
- [cli] Validate cloudUrl formats before `pulumi login` and throw an error if incorrect format specified
[#5550](https://github.com/pulumi/pulumi/pull/5545)
- [cli] Improve user experience when pulumi plugin rm --all finds no plugins
to remove. The previous behaviour was an error and should not be so.
[#5547](https://github.com/pulumi/pulumi/pull/5547)
## 2.11.2 (2020-10-01)
- feat(autoapi): expose EnvVars LocalWorkspaceOption to set in ctor

View file

@ -16,6 +16,7 @@ package main
import (
"fmt"
"github.com/pulumi/pulumi/sdk/v2/go/common/diag"
"github.com/blang/semver"
"github.com/hashicorp/go-multierror"
@ -89,7 +90,9 @@ func newPluginRmCmd() *cobra.Command {
}
if len(deletes) == 0 {
return errors.New("no plugins found")
cmdutil.Diag().Infof(
diag.Message("", "no plugins found to uninstall"))
return nil
}
// Confirm that the user wants to do this (unless --yes was passed), and do the deletes.