diff options
author | Eamonn <eamonnmcevoy@outlook.com> | 2017-03-21 23:10:31 +1100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-03-21 13:10:31 +0100 |
commit | 559b4007f71f048e2505c5aae253b96169274309 (patch) | |
tree | af5313974e36c7a9e16bd941c05ced9fe6253378 /commands | |
parent | 5e191ccf4c3f53dc73d78342157004bc78359fc7 (diff) |
commands: Keep "." directories on cleanDestinationDir
Fixes #3208
Diffstat (limited to 'commands')
-rw-r--r-- | commands/hugo.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/commands/hugo.go b/commands/hugo.go index 6bb786904..48d4e0dc1 100644 --- a/commands/hugo.go +++ b/commands/hugo.go @@ -579,8 +579,13 @@ func (c *commandeer) copyStatic() error { // Now that we are using a unionFs for the static directories // We can effectively clean the publishDir on initial sync syncer.Delete = c.Cfg.GetBool("cleanDestinationDir") + if syncer.Delete { c.Logger.INFO.Println("removing all files from destination that don't exist in static dirs") + + syncer.DeleteFilter = func(f os.FileInfo) bool { + return f.IsDir() && strings.HasPrefix(f.Name(), ".") + } } c.Logger.INFO.Println("syncing static files to", publishDir) |