pull/48/head
Henrique Dias 2016-02-11 20:52:56 +00:00
parent b266262c7a
commit c8c2d4e9b5
2 changed files with 2 additions and 6 deletions

View File

@ -143,9 +143,7 @@ func parseCompleteFile(r *http.Request, c *config.Config, rawFile map[string]int
file := f.Bytes()
// Write the file
err = ioutil.WriteFile(filename, file, 0666)
if err != nil {
if err = ioutil.WriteFile(filename, file, 0666); err != nil {
return
}

View File

@ -14,7 +14,6 @@ import (
"github.com/hacdias/caddy-hugo/assets"
"github.com/hacdias/caddy-hugo/config"
"github.com/spf13/hugo/commands"
"github.com/spf13/viper"
)
// CanBeEdited checks if the extension of a file is supported by the editor
@ -166,8 +165,7 @@ func ParseComponents(r *http.Request) []string {
// Run is used to run the static website generator
func Run(c *config.Config) {
viper.Reset()
c.Args = append([]string{"--source", c.Path, "--destination", "public"}, c.Args...)
c.Args = append([]string{"--source", c.Path}, c.Args...)
commands.HugoCmd.ParseFlags(c.Args)
if err := commands.HugoCmd.RunE(nil, nil); err != nil {
log.Print(err)