Skip to content

Commit

Permalink
Reorder Sentry initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
jodyheavener committed Jun 3, 2024
1 parent e355bca commit d72c05d
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions script/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,20 @@ func getEnv(key string) (string, error) {
}

func main() {
if len(os.Args) < 2 {
printUsageAndExit()
}

command := os.Args[1]

if len(os.Args) == 4 && os.Args[2] == "--test" {
setTestApplication(os.Args[3])
} else if len(os.Args) != 2 {
printUsageAndExit()
}

sentryDsn, err := getEnv("SENTRY_DSN")
if err != nil {
if err != nil && !isTesting() {
log.Fatal(err)
}

Expand All @@ -38,18 +50,6 @@ func main() {

defer sentry.Flush(2 * time.Second)

if len(os.Args) < 2 {
printUsageAndExit()
}

command := os.Args[1]

if len(os.Args) == 4 && os.Args[2] == "--test" {
setTestApplication(os.Args[3])
} else if len(os.Args) != 2 {
printUsageAndExit()
}

github := GitHub{}
application := Application{}

Expand Down

0 comments on commit d72c05d

Please sign in to comment.