summaryrefslogtreecommitdiffstats
path: root/commands/hugo.go
diff options
context:
space:
mode:
authorEamonn <eamonnmcevoy@outlook.com>2017-03-21 23:10:31 +1100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2017-03-21 13:10:31 +0100
commit559b4007f71f048e2505c5aae253b96169274309 (patch)
treeaf5313974e36c7a9e16bd941c05ced9fe6253378 /commands/hugo.go
parent5e191ccf4c3f53dc73d78342157004bc78359fc7 (diff)
commands: Keep "." directories on cleanDestinationDir
Fixes #3208
Diffstat (limited to 'commands/hugo.go')
-rw-r--r--commands/hugo.go5
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)