From c8c2d4e9b5fa7cfa29680e8c122cdbbdf68a5ab9 Mon Sep 17 00:00:00 2001 From: Henrique Dias Date: Thu, 11 Feb 2016 20:52:56 +0000 Subject: [PATCH] updates --- editor/post.go | 4 +--- utils/utils.go | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/editor/post.go b/editor/post.go index 1b4e685c..3532e711 100644 --- a/editor/post.go +++ b/editor/post.go @@ -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 } diff --git a/utils/utils.go b/utils/utils.go index c96aeddf..9ab2fed4 100644 --- a/utils/utils.go +++ b/utils/utils.go @@ -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)