From a8f665c1de2039a089ac93773eccd491688fc6fd Mon Sep 17 00:00:00 2001 From: Adam Moore Date: Fri, 12 Oct 2012 12:11:14 +0900 Subject: [PATCH] Use whichPygmentize generated path instead! --- tools/generate.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tools/generate.go b/tools/generate.go index ac71f5b..0602a11 100644 --- a/tools/generate.go +++ b/tools/generate.go @@ -70,18 +70,12 @@ func mustReadFile(path string) string { func cachedPygmentize(lex string, src string) string { ensureDir(cacheDir) arg := []string{"-l", lex, "-f", "html"} - - bin, err := exec.Command("which", "pygmentize").Output() - if err != nil { - fmt.Println("Please install Pygments and ensure pygmentize is in your path first.") - os.Exit(1) - } cachePath := cacheDir + "/pygmentize-" + strings.Join(arg, "-") + "-" + sha1Sum(src) cacheBytes, cacheErr := ioutil.ReadFile(cachePath) if cacheErr == nil { return string(cacheBytes) } - renderBytes := pipe(string(bin), arg, src) + renderBytes := pipe(pygmentizeBin, arg, src) writeErr := ioutil.WriteFile(cachePath, renderBytes, 0600) check(writeErr) return string(renderBytes)