commands: Keep "." directories on cleanDestinationDir
authorEamonn <eamonnmcevoy@outlook.com>
Tue, 21 Mar 2017 12:10:31 +0000 (23:10 +1100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 21 Mar 2017 12:10:31 +0000 (13:10 +0100)
Fixes #3208

commands/hugo.go
vendor/vendor.json

index 6bb786904be1418e18e86181cde6a69cf3d47d64..48d4e0dc11c3c129321fa50852f99f4ad672b3d3 100644 (file)
@@ -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)
 
index 3bbce3f2117e8ca446c3ab2ba3f9174ce83c15ea..3a9042c84cf5c449b8175b6183d5c27a12583351 100644 (file)
                        "revisionTime": "2017-02-17T16:44:07Z"
                },
                {
-                       "checksumSHA1": "NOrvS8XdRlWNXTvGi+oqEHlQYWA=",
+                       "checksumSHA1": "XSh/IxmHbGUf4tYB61wn9zK4g7U=",
                        "path": "github.com/spf13/fsync",
-                       "revision": "cb2da332d00cbc04e4f3f677520dc3e7cc11874b",
-                       "revisionTime": "2016-11-30T04:45:28Z"
+                       "revision": "12a01e648f05a938100a26858d2d59a120307a18",
+                       "revisionTime": "2017-03-20T14:25:52Z"
                },
                {
                        "checksumSHA1": "9pkkhgKp3mwSreiML3plQlQYdLQ=",