From ce46c90e1964c26111442c780d2c173c46d6ccad Mon Sep 17 00:00:00 2001 From: clsr Date: Thu, 16 Jun 2016 20:08:12 +0200 Subject: Prevent creation of empty dirs when ran outside of gomf-web --- main.go | 4 ++-- website.go | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index d795cb6..1b72477 100644 --- a/main.go +++ b/main.go @@ -53,6 +53,8 @@ func main() { rand.Seed(time.Now().UnixNano()) + initWebsite() + storage = NewStorage("upload", *maxSize) storage.ForbiddenExt = strings.Split(*forbidExt, ",") storage.ForbiddenMime = strings.Split(*forbidMime, ",") @@ -67,8 +69,6 @@ func main() { http.HandleFunc("/grill.php", handleGrill) } - initWebsite() - if uploadUrl == "" { if *listenHttps != "" { if uploadHost != "" { diff --git a/website.go b/website.go index e601bcd..a917979 100644 --- a/website.go +++ b/website.go @@ -14,7 +14,6 @@ import ( var templates *template.Template func initWebsite() { - os.MkdirAll("pages", 0755) pages, err := ioutil.ReadDir("pages") if err != nil { panic(err) -- cgit