ensures storage path exists
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user