mirror of
https://github.com/filebrowser/filebrowser.git
synced 2024-06-07 23:00:43 +00:00
fix #102
This commit is contained in:
parent
b192da1982
commit
282a93d705
13
setup.go
13
setup.go
@ -119,19 +119,14 @@ func parse(c *caddy.Controller, root string) (*Config, *filemanager.FileManager,
|
|||||||
return cfg, &filemanager.FileManager{}, c.ArgErr()
|
return cfg, &filemanager.FileManager{}, c.ArgErr()
|
||||||
}
|
}
|
||||||
|
|
||||||
values := strings.Split(c.Val(), " ")
|
flag := c.Val()
|
||||||
|
|
||||||
if len(values) == 0 {
|
|
||||||
return cfg, fm, errors.New("Not enough arguments for 'flag' option.")
|
|
||||||
}
|
|
||||||
|
|
||||||
value := "true"
|
value := "true"
|
||||||
|
|
||||||
if len(values) > 1 {
|
if c.NextArg() {
|
||||||
value = values[1]
|
value = c.Val()
|
||||||
}
|
}
|
||||||
|
|
||||||
cfg.Args = append(cfg.Args, "--"+values[0]+"="+value)
|
cfg.Args = append(cfg.Args, "--"+flag+"="+value)
|
||||||
case "before_publish":
|
case "before_publish":
|
||||||
if cfg.BeforePublish, err = config.CommandRunner(c); err != nil {
|
if cfg.BeforePublish, err = config.CommandRunner(c); err != nil {
|
||||||
return cfg, &filemanager.FileManager{}, err
|
return cfg, &filemanager.FileManager{}, err
|
||||||
|
Loading…
Reference in New Issue
Block a user