Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5bd8b53

Browse files
committed
chore: add site flag to buildinfo
1 parentd6766f7 commit5bd8b53

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

‎buildinfo/buildinfo.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ var (
2424
// Updated by buildinfo_slim.go on start.
2525
slimbool
2626

27+
// Updated by buildinfo_site.go on start.
28+
sitebool
29+
2730
// Injected with ldflags at build, see scripts/build_go.sh
2831
tagstring
2932
agplstring// either "true" or "false", ldflags does not support bools
@@ -95,6 +98,11 @@ func IsSlim() bool {
9598
returnslim
9699
}
97100

101+
// HasSite returns true if the frontend is embedded in the build.
102+
funcHasSite()bool {
103+
returnsite
104+
}
105+
98106
// IsAGPL returns true if this is an AGPL build.
99107
funcIsAGPL()bool {
100108
returnstrings.Contains(agpl,"t")

‎buildinfo/buildinfo_site.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
//go:build embed
2+
3+
package buildinfo
4+
5+
funcinit() {
6+
site=true
7+
}

‎cli/server.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,9 @@ func (r *RootCmd) Server(newAPI func(context.Context, *coderd.Options) (*coderd.
492492
BorderForeground(lipgloss.Color("12")).
493493
Render(fmt.Sprintf("View the Web UI:\n%s",
494494
pretty.Sprint(cliui.DefaultStyles.Hyperlink,accessURL))))
495-
_=openURL(inv,accessURL)
495+
ifbuildinfo.HasSite() {
496+
_=openURL(inv,accessURL)
497+
}
496498

497499
// Used for zero-trust instance identity with Google Cloud.
498500
googleTokenValidator,err:=idtoken.NewValidator(ctx,option.WithoutAuthentication())

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp