From 420cf6711e0f140cbb454e33d68155bb7908e282 Mon Sep 17 00:00:00 2001 From: Brian Rogers Date: Wed, 6 May 2026 21:43:04 -0600 Subject: [PATCH] ensures storage path exists --- internal/app/main.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/internal/app/main.go b/internal/app/main.go index 83b3ec0..f795192 100644 --- a/internal/app/main.go +++ b/internal/app/main.go @@ -8,6 +8,13 @@ import ( "github.com/joho/godotenv" ) +func resolveFileStorePath(path string) { + err := os.MkdirAll(path, os.ModePerm) + if err != nil { + log.Fatal(err) + } +} + func main() { err := godotenv.Load() if err != nil { @@ -18,6 +25,8 @@ func main() { storage_path := os.Getenv("STORAGE_PATH") + resolveFileStorePath(storage_path) + fmt.Printf("in the future I will listen on port: %s\n", port) fmt.Printf("Reading files from: %s\n", storage_path) }