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