Skip to content

Commit

Permalink
Merge pull request #50 from m-lab/sandbox-kinkade
Browse files Browse the repository at this point in the history
Create data dir if it doesn't exist
  • Loading branch information
nkinkade authored Mar 27, 2023
2 parents 730701a + 8e353e9 commit fce28bd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ func main() {
ifaces, err := processFlags()
rtx.Must(err, "Failed to process flags")

// Create the data directory. This will be a no-op if it already exists.
if *dir != "" {
rtx.PanicOnError(os.MkdirAll(*dir, 0775), "Could not create the data dir %s", *dir)
}

psrv := prometheusx.MustServeMetrics()
defer warnonerror.Close(psrv, "Could not stop metric server")

Expand Down

0 comments on commit fce28bd

Please sign in to comment.