mirror of
https://github.com/filebrowser/filebrowser.git
synced 2024-06-07 23:00:43 +00:00
update Hugo calls
This commit is contained in:
parent
e8874fabf1
commit
454c59e8a3
@ -62,7 +62,7 @@ func POST(w http.ResponseWriter, r *http.Request, c *config.Config) (int, error)
|
||||
args = append(args, "--kind", archetype)
|
||||
}
|
||||
|
||||
if err := utils.RunCommand("hugo", args, c.Path); err != nil {
|
||||
if err := utils.RunCommand(c.Hugo, args, c.Path); err != nil {
|
||||
return http.StatusInternalServerError, err
|
||||
}
|
||||
} else {
|
||||
|
@ -1,10 +1,10 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"os/user"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
@ -40,8 +40,9 @@ func ParseHugo(c *setup.Controller) (*Config, error) {
|
||||
conf.Hugo += ".exe"
|
||||
}
|
||||
|
||||
conf.Hugo = filepath.Clean(conf.Hugo)
|
||||
|
||||
if _, err := os.Stat(conf.Hugo); os.IsNotExist(err) {
|
||||
fmt.Print("hey")
|
||||
insthugo.Install()
|
||||
}
|
||||
|
||||
|
2
hugo.go
2
hugo.go
@ -45,7 +45,7 @@ func Setup(c *setup.Controller) (middleware.Middleware, error) {
|
||||
}
|
||||
|
||||
if create {
|
||||
err := utils.RunCommand("hugo", []string{"new", "site", config.Path, "--force"}, ".")
|
||||
err := utils.RunCommand(config.Hugo, []string{"new", "site", config.Path, "--force"}, ".")
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
|
@ -178,7 +178,7 @@ func Run(c *config.Config, force bool) {
|
||||
}
|
||||
}
|
||||
|
||||
if err := RunCommand("hugo", c.Args, c.Path); err != nil {
|
||||
if err := RunCommand(c.Hugo, c.Args, c.Path); err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user