rename filename to dirPath

This commit is contained in:
Hayden 2022-08-15 07:34:22 -08:00 committed by Dan Buch
parent 87f003f087
commit 2b1a8cad54
Signed by: meatballhat
GPG Key ID: A12F782281063434

View File

@ -222,9 +222,9 @@ func GfmrunActionFunc(cCtx *cli.Context) error {
return err
}
filename := cCtx.Args().Get(0)
if filename == "" {
filename = "README.md"
dirPath := cCtx.Args().Get(0)
if dirPath == "" {
dirPath = "README.md"
}
walk := cCtx.Bool("walk")
@ -232,7 +232,7 @@ func GfmrunActionFunc(cCtx *cli.Context) error {
if walk {
// Walk the directory and find all markdown files.
err := filepath.Walk(filename, func(path string, info os.FileInfo, err error) error {
err := filepath.Walk(dirPath, func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
}
@ -252,7 +252,7 @@ func GfmrunActionFunc(cCtx *cli.Context) error {
return err
}
} else {
sources = append(sources, filename)
sources = append(sources, dirPath)
}
var counter int