Skip to content

Commit

Permalink
Fix for interactive prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
Laica-Lunasys committed Oct 21, 2021
1 parent 77e3eb2 commit f51a64a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions service/saml2aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ func (pr *Provider) Login(profile string, opts *LoginOption, mfa *MFA) error {
if err := exec.Command(f, "--help").Run(); err == nil {
fxBin = f
}
} else if err := exec.Command("firefox", "--help").Run(); err == nil {
} else if err := pr.execute("firefox", "--help").Run(); err == nil {
fxBin = "firefox"
} else if err := exec.Command("firefox.exe", "--help").Run(); err == nil {
} else if err := pr.execute("firefox.exe", "--help").Run(); err == nil {
fxBin = "firefox.exe"
} else if err := exec.Command("/Applications/Firefox.app/Contents/MacOS/firefox", "--help").Run(); err == nil {
} else if err := pr.execute("/Applications/Firefox.app/Contents/MacOS/firefox", "--help").Run(); err == nil {
fxBin = "/Applications/Firefox.app/Contents/MacOS/firefox"
}

Expand Down Expand Up @@ -163,6 +163,7 @@ func (pr *Provider) GetProfiles() ([]string, error) {

func (pr *Provider) execute(command string, args ...string) *exec.Cmd {
cmd := exec.Command(command, args...)
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
return cmd
Expand Down

0 comments on commit f51a64a

Please sign in to comment.