From a5c98d3928d402fdfa00821c3289ca8f50a5a80c Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Sun, 22 Jan 2023 15:02:39 -0500 Subject: [PATCH] Do not run the toc command on windows --- build.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/build.go b/build.go index 5d79b3f952..f5561cd93f 100644 --- a/build.go +++ b/build.go @@ -11,6 +11,7 @@ import ( "log" "os" "os/exec" + "runtime" "strings" "github.com/urfave/cli" @@ -164,12 +165,17 @@ func GfmrunActionFunc(c *cli.Context) error { } func TocActionFunc(c *cli.Context) error { + if runtime.GOOS == "windows" { + log.Println("the toc command is not meant for windows") + return nil + } + filename := c.Args().Get(0) if filename == "" { filename = "README.md" } - err := runCmd("node", "node_modules/.bin/markdown-toc", "-i", filename) + err := runCmd("node_modules/.bin/markdown-toc", "-i", filename) if err != nil { return err }