Skip to content

Commit

Permalink
Set absolute bash path
Browse files Browse the repository at this point in the history
and slightly revert assertion in docs test to ensure flag ordering
  • Loading branch information
meatballhat committed May 23, 2022
1 parent 5edc1b9 commit 8f47e6d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/v2/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ For example this:

<!-- {
"args": ["&#45;&#45;help"],
"output": ".*Language for the greeting.*"
"output": ".*Load configuration from FILE\n.*\n.*Language for the greeting.*"
} -->
``` go
package main
Expand Down
8 changes: 7 additions & 1 deletion internal/build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,13 @@ func testCleanup(packages []string) error {
func GfmrunActionFunc(cCtx *cli.Context) error {
top := cCtx.Path("top")

bash, err := exec.LookPath("bash")
if err != nil {
return err
}

os.Setenv("SHELL", bash)

tmpDir, err := os.MkdirTemp("", "urfave-cli*")
if err != nil {
return err
Expand All @@ -203,7 +210,6 @@ func GfmrunActionFunc(cCtx *cli.Context) error {
}

os.Setenv("TMPDIR", tmpDir)
os.Setenv("SHELL", "bash")

if err := os.Chdir(wd); err != nil {
return err
Expand Down

0 comments on commit 8f47e6d

Please sign in to comment.