close #46; needs doc update
parent
c274391865
commit
7ebdadbbab
|
@ -42,21 +42,19 @@ func ParseHugo(c *setup.Controller) (*Config, error) {
|
||||||
conf.Styles = strings.TrimPrefix(conf.Styles, "/")
|
conf.Styles = strings.TrimPrefix(conf.Styles, "/")
|
||||||
// Add a beginning slash to make a
|
// Add a beginning slash to make a
|
||||||
conf.Styles = "/" + conf.Styles
|
conf.Styles = "/" + conf.Styles
|
||||||
case "args":
|
default:
|
||||||
if !c.NextArg() {
|
key := "--" + c.Val()
|
||||||
return nil, c.ArgErr()
|
value := "true"
|
||||||
|
|
||||||
|
if c.NextArg() {
|
||||||
|
value = c.Val()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the arguments and split the array
|
conf.Args = append(conf.Args, key, value)
|
||||||
args := strings.Split(c.Val(), " ")
|
|
||||||
for index, element := range args {
|
|
||||||
args[index] = strings.Replace(element, "\"", "", -1)
|
|
||||||
}
|
|
||||||
|
|
||||||
conf.Args = args
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
conf.Args = append([]string{"--source", conf.Path}, conf.Args...)
|
||||||
return conf, nil
|
return conf, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -170,7 +170,6 @@ func Run(c *config.Config) {
|
||||||
|
|
||||||
commands.MainSite = nil
|
commands.MainSite = nil
|
||||||
viper.Reset()
|
viper.Reset()
|
||||||
c.Args = append([]string{"--source", c.Path}, c.Args...)
|
|
||||||
commands.HugoCmd.ParseFlags(c.Args)
|
commands.HugoCmd.ParseFlags(c.Args)
|
||||||
if err := commands.HugoCmd.RunE(nil, nil); err != nil {
|
if err := commands.HugoCmd.RunE(nil, nil); err != nil {
|
||||||
log.Print(err)
|
log.Print(err)
|
||||||
|
|
Loading…
Reference in New Issue