diff --git a/cmd/root.go b/cmd/root.go index 5a1072284..bf7922b11 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -145,12 +145,12 @@ func Execute() { if err != nil { fmt.Fprintln(utils.GetDebugLogger(), err) } - if semver.Compare(version, "v"+utils.Version) > 0 { - fmt.Fprintln(os.Stderr, suggestUpgrade(version)) - } if len(utils.CmdSuggestion) > 0 { fmt.Fprintln(os.Stderr, utils.CmdSuggestion) } + if semver.Compare(version, "v"+utils.Version) > 0 { + fmt.Fprintln(os.Stderr, suggestUpgrade(version)) + } } func checkUpgrade(ctx context.Context, fsys afero.Fs) (string, error) { diff --git a/internal/status/status.go b/internal/status/status.go index ee087062b..77d9a31dc 100644 --- a/internal/status/status.go +++ b/internal/status/status.go @@ -12,7 +12,6 @@ import ( "os" "reflect" "slices" - "strings" "sync" "time" @@ -100,6 +99,10 @@ func Run(ctx context.Context, names CustomName, format string, fsys afero.Fs) er if len(stopped) > 0 { fmt.Fprintln(os.Stderr, "Stopped services:", stopped) } + // Set suggestion to use new keys instead of deprecated ones + if utils.Config.Auth.Enabled && !slices.Contains(stopped, utils.GotrueId) && !slices.Contains(stopped, utils.ShortContainerImageName(utils.Config.Auth.Image)) { + utils.CmdSuggestion = utils.Orange("Please use publishable and secret key instead of anon and service role key.") + } if format == utils.OutputPretty { fmt.Fprintf(os.Stderr, "%s local development setup is running.\n\n", utils.Aqua("supabase")) PrettyPrint(os.Stdout, stopped...) @@ -230,24 +233,11 @@ func PrettyPrint(w io.Writer, exclude ...string) { } values := names.toValues(exclude...) // Iterate through map in order of declared struct fields - t := reflect.TypeOf(names) val := reflect.ValueOf(names) for i := 0; i < val.NumField(); i++ { k := val.Field(i).String() - if tag := t.Field(i).Tag.Get("env"); isDeprecated(tag) { - continue - } if v, ok := values[k]; ok { fmt.Fprintf(w, "%s: %s\n", k, v) } } } - -func isDeprecated(tag string) bool { - for part := range strings.SplitSeq(tag, ",") { - if strings.EqualFold(part, "deprecated") { - return true - } - } - return false -} diff --git a/internal/utils/colors.go b/internal/utils/colors.go index ed710c4a2..f2fa94752 100644 --- a/internal/utils/colors.go +++ b/internal/utils/colors.go @@ -13,6 +13,10 @@ func Yellow(str string) string { return lipgloss.NewStyle().Foreground(lipgloss.Color("11")).Render(str) } +func Orange(str string) string { + return lipgloss.NewStyle().Foreground(lipgloss.Color("214")).Render(str) +} + // For errors. func Red(str string) string { return lipgloss.NewStyle().Foreground(lipgloss.Color("9")).Render(str)