No double slash when destination set to '/'
authorspf13 <steve.francia@gmail.com>
Tue, 17 Nov 2015 02:53:05 +0000 (21:53 -0500)
committerspf13 <steve.francia@gmail.com>
Tue, 17 Nov 2015 02:56:14 +0000 (21:56 -0500)
commands/hugo.go

index ae9a3f6ddffaee953dadb2e91d9fc075ebce88b7..a805d05dbcb03041c907f515651e8f82aca59524 100644 (file)
@@ -352,6 +352,11 @@ func build(watches ...bool) {
 func copyStatic() error {
        publishDir := helpers.AbsPathify(viper.GetString("PublishDir")) + "/"
 
+       // If root, remove the second '/'
+       if publishDir == "//" {
+               publishDir = "/"
+       }
+
        syncer := fsync.NewSyncer()
        syncer.NoTimes = viper.GetBool("notimes")
        syncer.SrcFs = hugofs.SourceFs