Set absolute bash path

and slightly revert assertion in docs test to ensure flag ordering
This commit is contained in:
Dan Buch 2022-05-23 07:44:58 -04:00
parent 5edc1b95e8
commit 8f47e6dc97
Signed by: meatballhat
GPG Key ID: A12F782281063434
2 changed files with 8 additions and 2 deletions

View File

@ -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

View File

@ -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
@ -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