Skip to content

Commit

Permalink
feat: add support for -- on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
piksel committed Mar 1, 2021
1 parent 6ad23c1 commit 91cd48a
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
4 changes: 1 addition & 3 deletions strategy/credentials/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"os/exec"
"path/filepath"
"strings"
"syscall"
"time"

"github.com/aws/aws-sdk-go/aws"
Expand Down Expand Up @@ -115,8 +114,7 @@ func (c *Credentials) Exec(app string, args []string) error {

log.Debug(logExec, cmd, args)

return syscall.Exec(cmd, args, env.ToEnv())

return exec_(cmd, args, env.ToEnv())
}

// IsValid indicates if a loaded credential is (still) valid
Expand Down
9 changes: 9 additions & 0 deletions strategy/credentials/credentials_nonwin.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// +build !windows

package credentials

import "syscall"

func exec_(cmd string, args []string, env []string) error {
return syscall.Exec(cmd, args, env)
}
17 changes: 17 additions & 0 deletions strategy/credentials/credentials_win.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// +build windows

package credentials

import (
"os"
"os/exec"
)

func exec_(cmd string, args []string, env []string) error {
c := exec.Command(cmd, args[1:]...)
c.Env = env
c.Stdin = os.Stdin
c.Stdout = os.Stdout
c.Stderr = os.Stderr
return c.Run()
}

0 comments on commit 91cd48a

Please sign in to comment.