shithub: hugo

Download patch

ref: be540f5b8fb340f1edfb1ed10c11334bbb85927b
parent: 0fcb78e43bbf7ac00b0cc72c5813a08942c1fe51
author: bep <[email protected]>
date: Tue Apr 14 15:58:37 EDT 2015

Fix potential Windows path issue with Pygments cache

--- a/helpers/pygments.go
+++ b/helpers/pygments.go
@@ -20,6 +20,7 @@
 	"io"
 	"io/ioutil"
 	"os/exec"
+	"path/filepath"
 	"strings"
 
 	"github.com/spf13/hugo/hugofs"
@@ -62,7 +63,7 @@
 	io.WriteString(hash, style)
 	io.WriteString(hash, noclasses)
 
-	cachefile := fmt.Sprintf("%s/pygments-%x", viper.GetString("CacheDir"), hash.Sum(nil))
+	cachefile := filepath.Join(viper.GetString("CacheDir"), fmt.Sprintf("pygments-%x", hash.Sum(nil)))
 	exists, err := Exists(cachefile, fs)
 	if err != nil {
 		jww.ERROR.Print(err.Error())