Bugfix for issue #1628 where Caddyfile is not being hidden correctly on windows.

Added test case to check if Caddyfile is added to HiddenFiles correctly.
This commit is contained in:
Simon Lightfoot
2017-05-01 03:15:59 +01:00
parent 49d79d7ebc
commit 8f09ed8f0d
2 changed files with 25 additions and 1 deletions

View File

@@ -70,7 +70,7 @@ func hideCaddyfile(cctx caddy.Context) error {
return err
}
if strings.HasPrefix(absOriginCaddyfile, absRoot) {
cfg.HiddenFiles = append(cfg.HiddenFiles, strings.TrimPrefix(absOriginCaddyfile, absRoot))
cfg.HiddenFiles = append(cfg.HiddenFiles, filepath.ToSlash(strings.TrimPrefix(absOriginCaddyfile, absRoot)))
}
}
return nil