add support for windows

This commit is contained in:
Ajitem Sahasrabuddhe 2019-12-06 12:04:24 +05:30
parent 9f5fad1989
commit 55924039a1
No known key found for this signature in database
GPG Key ID: 5B0EE10DAA76876C

View File

@ -10,6 +10,7 @@ import (
"log" "log"
"os" "os"
"os/exec" "os/exec"
"runtime"
"strings" "strings"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
@ -157,8 +158,12 @@ func GfmrunActionFunc(c *cli.Context) error {
return err return err
} }
if runtime.GOOS == "windows" {
return runCmd("gfmrun.exe", "-c", fmt.Sprint(counter), "-s", filename)
} else {
return runCmd("gfmrun", "-c", fmt.Sprint(counter), "-s", filename) return runCmd("gfmrun", "-c", fmt.Sprint(counter), "-s", filename)
} }
}
func TocActionFunc(c *cli.Context) error { func TocActionFunc(c *cli.Context) error {
filename := c.Args().Get(0) filename := c.Args().Get(0)