1
0

Task collection improvements (#109)

This commit is contained in:
konrad
2019-12-01 13:38:11 +00:00
parent d96831fe3a
commit 7e4deab8f7
81 changed files with 44585 additions and 38569 deletions

View File

@ -127,8 +127,13 @@ func testCleanup() error {
return nil
}
func GfmrunActionFunc(_ *cli.Context) error {
file, err := os.Open("README.md")
func GfmrunActionFunc(c *cli.Context) error {
filename := c.Args().Get(0)
if filename == "" {
filename = "README.md"
}
file, err := os.Open(filename)
if err != nil {
return err
}
@ -146,11 +151,16 @@ func GfmrunActionFunc(_ *cli.Context) error {
return err
}
return runCmd("gfmrun", "-c", fmt.Sprint(counter), "-s", "README.md")
return runCmd("gfmrun", "-c", fmt.Sprint(counter), "-s", filename)
}
func TocActionFunc(_ *cli.Context) error {
err := runCmd("node_modules/.bin/markdown-toc", "-i", "README.md")
func TocActionFunc(c *cli.Context) error {
filename := c.Args().Get(0)
if filename == "" {
filename = "README.md"
}
err := runCmd("node_modules/.bin/markdown-toc", "-i", filename)
if err != nil {
return err
}