Make filesDir if it does not exist
This commit is contained in:
parent
a8117de38d
commit
11cb55232a
|
@ -6,6 +6,8 @@ import (
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
"os"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"github.com/flosch/pongo2"
|
"github.com/flosch/pongo2"
|
||||||
"github.com/zenazn/goji"
|
"github.com/zenazn/goji"
|
||||||
|
@ -37,7 +39,12 @@ func main() {
|
||||||
goji.Abandon(middleware.Logger)
|
goji.Abandon(middleware.Logger)
|
||||||
}
|
}
|
||||||
|
|
||||||
// check trailing slashes
|
// make directory if needed
|
||||||
|
err := os.MkdirAll(Config.filesDir, 0755)
|
||||||
|
if err != nil {
|
||||||
|
fmt.Printf("Error: could not create files directory")
|
||||||
|
os.exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
// Template Globals
|
// Template Globals
|
||||||
pongo2.DefaultSet.Globals["sitename"] = Config.siteName
|
pongo2.DefaultSet.Globals["sitename"] = Config.siteName
|
||||||
|
|
Loading…
Reference in New Issue