Skip to content

Commit

Permalink
Do not run the toc command on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
meatballhat committed Jan 22, 2023
1 parent 9b65c47 commit a5c98d3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion build.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"log"
"os"
"os/exec"
"runtime"
"strings"

"github.com/urfave/cli"
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit a5c98d3

Please sign in to comment.