Skip to content

Commit 58ef834

Browse files
committed
check buildinfo for devel prerelease tag
1 parent 8f5268a commit 58ef834

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cli/server.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"path/filepath"
2020
"time"
2121

22+
"github.com/coder/coder/buildinfo"
2223
"github.com/coder/coder/provisioner/echo"
2324

2425
"github.com/briandowns/spinner"
@@ -29,6 +30,7 @@ import (
2930
"github.com/prometheus/client_golang/prometheus/promhttp"
3031
"github.com/spf13/cobra"
3132
sdktrace "go.opentelemetry.io/otel/sdk/trace"
33+
"golang.org/x/mod/semver"
3234
"golang.org/x/oauth2"
3335
xgithub "golang.org/x/oauth2/github"
3436
"golang.org/x/xerrors"
@@ -98,7 +100,8 @@ func server() *cobra.Command {
98100
Short: "Start a Coder server",
99101
RunE: func(cmd *cobra.Command, args []string) error {
100102
logger := slog.Make(sloghuman.Sink(os.Stderr))
101-
if verbose || dev {
103+
buildModeDev := semver.Prerelease(buildinfo.Version()) == "-devel"
104+
if verbose || buildModeDev {
102105
logger = logger.Leveled(slog.LevelDebug)
103106
}
104107

0 commit comments

Comments
 (0)