Skip to content

Commit 7f1ace9

Browse files
CLOUDP-115791: [CLI] Disable alert feature for completion command (#1048)
1 parent 5abfaf5 commit 7f1ace9

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

internal/cli/root/atlas/builder.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ func Builder(profile *string) *cobra.Command {
111111
return validate.Credentials()
112112
},
113113
PersistentPostRun: func(cmd *cobra.Command, args []string) {
114+
// we don't run the release alert feature on the completion command
115+
if strings.HasPrefix(cmd.CommandPath(), fmt.Sprintf("%s %s", atlas, "completion")) {
116+
return
117+
}
118+
114119
w := cmd.ErrOrStderr()
115120
fs := afero.NewOsFs()
116121
f, _ := latestrelease.NewVersionFinder(fs, version.NewReleaseVersionDescriber())

internal/cli/root/mongocli/builder.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"fmt"
1919
"io"
2020
"runtime"
21+
"strings"
2122
"time"
2223

2324
"github.com/mongodb/mongocli/internal/cli"
@@ -63,6 +64,11 @@ func Builder(profile *string, argsWithoutProg []string) *cobra.Command {
6364
"toc": "true",
6465
},
6566
PersistentPostRun: func(cmd *cobra.Command, args []string) {
67+
// we don't run the release alert feature on the completion command
68+
if strings.HasPrefix(cmd.CommandPath(), "mongocli completion") {
69+
return
70+
}
71+
6672
w := cmd.ErrOrStderr()
6773
fs := afero.NewOsFs()
6874
f, _ := latestrelease.NewVersionFinder(fs, version.NewReleaseVersionDescriber())

0 commit comments

Comments
 (0)