diff options
author | John Weldon <johnweldon4@gmail.com> | 2020-05-13 16:20:52 -0700 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-05-14 09:56:53 +0200 |
commit | 558c09305e2be16953238c6c0e828f62b950e4f5 (patch) | |
tree | 820d81f85123a82ec28ff67779a321a492184496 /deploy/deploy.go | |
parent | b69a36140f42ec99ffa2d1e029b8b86ecf8ff929 (diff) |
deploy: Do not suppress .well-known/ directory
Deployments ignore directories with a leading `.`, but should not ignore
certain well known 'hidden' directories like `.well-known/`
Fixes #6691
Diffstat (limited to 'deploy/deploy.go')
-rw-r--r-- | deploy/deploy.go | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/deploy/deploy.go b/deploy/deploy.go index c7a4510c2..9a38072a7 100644 --- a/deploy/deploy.go +++ b/deploy/deploy.go @@ -440,6 +440,21 @@ func (lf *localFile) MD5() []byte { return lf.md5 } +// knownHiddenDirectory checks if the specified name is a well known +// hidden directory. +func knownHiddenDirectory(name string) bool { + var knownDirectories = []string{ + ".well-known", + } + + for _, dir := range knownDirectories { + if name == dir { + return true + } + } + return false +} + // walkLocal walks the source directory and returns a flat list of files, // using localFile.SlashPath as the map keys. func walkLocal(fs afero.Fs, matchers []*matcher, include, exclude glob.Glob) (map[string]*localFile, error) { @@ -451,7 +466,10 @@ func walkLocal(fs afero.Fs, matchers []*matcher, include, exclude glob.Glob) (ma if info.IsDir() { // Skip hidden directories. if path != "" && strings.HasPrefix(info.Name(), ".") { - return filepath.SkipDir + // Except for specific hidden directories + if !knownHiddenDirectory(info.Name()) { + return filepath.SkipDir + } } return nil } |