Commit 73273c5b authored by Matthew Holt's avatar Matthew Holt

Ensure assets path exists before writing UUID file

parent 93c52563
...@@ -355,7 +355,12 @@ func initTelemetry() error { ...@@ -355,7 +355,12 @@ func initTelemetry() error {
newUUID := func() uuid.UUID { newUUID := func() uuid.UUID {
id := uuid.New() id := uuid.New()
err := ioutil.WriteFile(uuidFilename, []byte(id.String()), 0600) // human-readable as a string err := os.MkdirAll(caddy.AssetsPath(), 0700)
if err != nil {
log.Printf("[ERROR] Persisting instance UUID: %v", err)
return id
}
err = ioutil.WriteFile(uuidFilename, []byte(id.String()), 0600) // human-readable as a string
if err != nil { if err != nil {
log.Printf("[ERROR] Persisting instance UUID: %v", err) log.Printf("[ERROR] Persisting instance UUID: %v", err)
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment