updates
parent
b266262c7a
commit
c8c2d4e9b5
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue