No double slash when destination set to '/'

This commit is contained in:
spf13 2015-11-16 21:53:05 -05:00
parent ef0b9b511c
commit cb48425f2d

View file

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