Skip to content

Commit

Permalink
Don't autoupdate on fly version (#3630)
Browse files Browse the repository at this point in the history
  • Loading branch information
rugwirobaker committed Jun 18, 2024
1 parent e1491ed commit 7c73b99
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/command/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ func startQueryingForNewRelease(ctx context.Context) (context.Context, error) {
// would return true for "fly version upgrade" and "fly machine status"
func shouldIgnore(ctx context.Context, cmds [][]string) bool {
cmd := FromContext(ctx)

for _, ignoredCmd := range cmds {
match := true
currentCmd := cmd
Expand All @@ -360,12 +361,15 @@ func shouldIgnore(ctx context.Context, cmds [][]string) bool {
func promptAndAutoUpdate(ctx context.Context) (context.Context, error) {
cfg := config.FromContext(ctx)
if shouldIgnore(ctx, [][]string{
{"version"},
{"version", "upgrade"},
{"settings", "autoupdate"},
}) {
return ctx, nil
}

logger.FromContext(ctx).Debug("checking for updates...")

if !update.Check() {
return ctx, nil
}
Expand Down

0 comments on commit 7c73b99

Please sign in to comment.