mirror of
https://github.com/filebrowser/filebrowser.git
synced 2024-06-07 23:00:43 +00:00
remove caddydev from travis
This commit is contained in:
parent
6dd1a979cd
commit
d7cbd9355e
@ -6,7 +6,6 @@ go:
|
||||
install:
|
||||
- go get $(go list -f '{{join .Imports "\n"}}' ./... | sort | uniq | grep -v caddy-hugo) || true
|
||||
- go get github.com/mholt/caddy/caddyhttp
|
||||
- go get github.com/caddyserver/caddydev
|
||||
|
||||
script:
|
||||
- sed -i 's/\_ \"github.com\/mholt\/caddy\/caddyhttp\"/\_ \"github.com\/mholt\/caddy\/caddyhttp\"\n\_ \"github.com\/hacdias\/caddy-hugo\"/g' $GOPATH/src/github.com/mholt/caddy/caddy/caddymain/run.go
|
||||
|
20
setup.go
20
setup.go
@ -72,6 +72,7 @@ type Config struct {
|
||||
BaseURL string // BaseURL of admin interface
|
||||
WebDavURL string
|
||||
CleanPublic bool
|
||||
AllowPublish bool
|
||||
BeforePublish config.CommandFunc
|
||||
AfterPublish config.CommandFunc
|
||||
}
|
||||
@ -118,7 +119,7 @@ func parse(c *caddy.Controller, root string) (*Config, *filemanager.FileManager,
|
||||
switch c.Val() {
|
||||
case "flag":
|
||||
if !c.NextArg() {
|
||||
return cfg, &filemanager.FileManager{}, c.ArgErr()
|
||||
return nil, nil, c.ArgErr()
|
||||
}
|
||||
|
||||
flag := c.Val()
|
||||
@ -129,15 +130,24 @@ func parse(c *caddy.Controller, root string) (*Config, *filemanager.FileManager,
|
||||
}
|
||||
|
||||
cfg.Args = append(cfg.Args, "--"+flag+"="+value)
|
||||
case "allow_publish":
|
||||
if !c.NextArg() {
|
||||
return nil, nil, c.ArgErr()
|
||||
}
|
||||
|
||||
cfg.AllowPublish, err = strconv.ParseBool(c.Val())
|
||||
if err != nil {
|
||||
return nil, nil, c.ArgErr()
|
||||
}
|
||||
case "clean_public":
|
||||
if !c.NextArg() {
|
||||
return cfg, &filemanager.FileManager{}, c.ArgErr()
|
||||
return nil, nil, c.ArgErr()
|
||||
}
|
||||
|
||||
cfg.CleanPublic, err = strconv.ParseBool(c.Val())
|
||||
|
||||
if err != nil {
|
||||
return cfg, &filemanager.FileManager{}, c.ArgErr()
|
||||
return nil, nil, c.ArgErr()
|
||||
}
|
||||
case "before_publish":
|
||||
if cfg.BeforePublish, err = config.CommandRunner(c); err != nil {
|
||||
@ -165,7 +175,7 @@ func parse(c *caddy.Controller, root string) (*Config, *filemanager.FileManager,
|
||||
fmConfig, err := config.Parse(caddy.NewTestController("http", tokens))
|
||||
|
||||
if err != nil {
|
||||
return cfg, fm, err
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
fm = &filemanager.FileManager{Configs: fmConfig}
|
||||
@ -173,7 +183,7 @@ func parse(c *caddy.Controller, root string) (*Config, *filemanager.FileManager,
|
||||
cfg.WebDavURL = fm.Configs[0].WebDavURL
|
||||
|
||||
if err != nil {
|
||||
return cfg, fm, err
|
||||
return nil, nil, err
|
||||
}
|
||||
|
||||
return cfg, fm, nil
|
||||
|
Loading…
Reference in New Issue
Block a user