Set absolute bash
path
and slightly revert assertion in docs test to ensure flag ordering
This commit is contained in:
parent
5edc1b95e8
commit
8f47e6dc97
@ -363,7 +363,7 @@ For example this:
|
|||||||
|
|
||||||
<!-- {
|
<!-- {
|
||||||
"args": ["--help"],
|
"args": ["--help"],
|
||||||
"output": ".*Language for the greeting.*"
|
"output": ".*Load configuration from FILE\n.*\n.*Language for the greeting.*"
|
||||||
} -->
|
} -->
|
||||||
``` go
|
``` go
|
||||||
package main
|
package main
|
||||||
|
@ -182,6 +182,13 @@ func testCleanup(packages []string) error {
|
|||||||
func GfmrunActionFunc(cCtx *cli.Context) error {
|
func GfmrunActionFunc(cCtx *cli.Context) error {
|
||||||
top := cCtx.Path("top")
|
top := cCtx.Path("top")
|
||||||
|
|
||||||
|
bash, err := exec.LookPath("bash")
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
os.Setenv("SHELL", bash)
|
||||||
|
|
||||||
tmpDir, err := os.MkdirTemp("", "urfave-cli*")
|
tmpDir, err := os.MkdirTemp("", "urfave-cli*")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -203,7 +210,6 @@ func GfmrunActionFunc(cCtx *cli.Context) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
os.Setenv("TMPDIR", tmpDir)
|
os.Setenv("TMPDIR", tmpDir)
|
||||||
os.Setenv("SHELL", "bash")
|
|
||||||
|
|
||||||
if err := os.Chdir(wd); err != nil {
|
if err := os.Chdir(wd); err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user