File tree Expand file tree Collapse file tree 5 files changed +99
-1
lines changed
Expand file tree Collapse file tree 5 files changed +99
-1
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ builds:
1313 binary : bin/depot
1414 main : ./cmd/depot
1515 ldflags :
16- - -s -w -X github.com/depot/cli/internal/build.Version={{.Version}} -X github.com/depot/cli/internal/build.Date={{time "2006-01-02"}}
16+ - -s -w -X github.com/depot/cli/internal/build.Version={{.Version}} -X github.com/depot/cli/internal/build.Date={{time "2006-01-02"}} -X github.com/depot/cli/internal/build.SentryEnvironment=release
1717 - -X main.updaterEnabled=depot/cli
1818 id : macos
1919 goos : [darwin]
Original file line number Diff line number Diff line change 11package main
22
33import (
4+ "log"
45 "os"
56
67 "github.com/depot/cli/internal/build"
78 "github.com/depot/cli/pkg/cmd/root"
9+ "github.com/getsentry/sentry-go"
810)
911
1012func main () {
@@ -13,6 +15,17 @@ func main() {
1315}
1416
1517func runMain () int {
18+ if os .Getenv ("DEPOT_ERROR_TELEMETRY" ) != "0" {
19+ err := sentry .Init (sentry.ClientOptions {
20+ Dsn :
"https://[email protected] /6271909" ,
21+ Environment : build .SentryEnvironment ,
22+ Release : build .Version ,
23+ })
24+ if err != nil {
25+ log .Fatalf ("sentry.Init: %s" , err )
26+ }
27+ }
28+
1629 buildVersion := build .Version
1730 buildDate := build .Date
1831
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ require (
1111 github.com/docker/distribution v2.8.0+incompatible
1212 github.com/docker/docker v20.10.7+incompatible
1313 github.com/docker/go-units v0.4.0
14+ github.com/getsentry/sentry-go v0.13.0
1415 github.com/moby/buildkit v0.10.0-rc2.0.20220308185020-fdecd0ae108b
1516 github.com/morikuni/aec v1.0.0
1617 github.com/pkg/errors v0.9.1
You can’t perform that action at this time.
0 commit comments