forked from remote/oauth2
Fix usage of exec.Command
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -81,7 +82,8 @@ var baseEnv = os.Environ
|
|||||||
|
|
||||||
// runCommand is basically an alias of exec.CommandContext for testing.
|
// runCommand is basically an alias of exec.CommandContext for testing.
|
||||||
var runCommand = func(ctx context.Context, command string, env []string) ([]byte, error) {
|
var runCommand = func(ctx context.Context, command string, env []string) ([]byte, error) {
|
||||||
cmd := exec.CommandContext(ctx, command)
|
splitCommand := strings.Fields(command)
|
||||||
|
cmd := exec.CommandContext(ctx, splitCommand[0], splitCommand[1:]...)
|
||||||
cmd.Env = env
|
cmd.Env = env
|
||||||
|
|
||||||
response, err := cmd.Output()
|
response, err := cmd.Output()
|
||||||
|
|||||||
Reference in New Issue
Block a user