aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclsr <clsr@clsr.net>2016-06-16 20:08:12 +0200
committerclsr <clsr@clsr.net>2016-06-16 20:08:12 +0200
commitce46c90e1964c26111442c780d2c173c46d6ccad (patch)
tree127e662fb30797d848853f983f29f8768f268af2
parent629fcd4f297ffb34b4f3b54326645eabd42ab32c (diff)
downloadgomf-ce46c90e1964c26111442c780d2c173c46d6ccad.tar.gz
gomf-ce46c90e1964c26111442c780d2c173c46d6ccad.zip
Prevent creation of empty dirs when ran outside of gomf-webv0.1.4
-rw-r--r--main.go4
-rw-r--r--website.go1
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)