azote-backend/initializers/assets.go

20 lines
319 B
Go
Raw Normal View History

package initializers
import (
"log"
"os"
)
2024-02-28 09:13:08 +01:00
var DebugBasePath string = "./assets/"
var ReleaseBasePath string = "/data/assets/"
2024-02-28 09:13:08 +01:00
func CreateAssetsFolder(basePath string) {
2024-03-02 00:04:00 +01:00
if _, err := os.Stat(basePath); os.IsNotExist(err) {
if err := os.MkdirAll(basePath, os.ModePerm); err != nil {
log.Fatal(err)
}
}
}