Skip to content

Commit

Permalink
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/cmd/run.go
Original file line number Diff line number Diff line change
@@ -133,8 +133,8 @@ func init() {
runCmd.Flags().StringP("config", "c", "", "enclave config (e.g. dev)")

runCmd.Flags().String("fallback", "", "write secrets to this file after connecting to Doppler. secrets will be read from this file if future connection attempts are unsuccessful.")
runCmd.Flags().Bool("fallback-readonly", false, "do not update or modify the fallback file")
runCmd.Flags().Bool("fallback-only", false, "do not request secrets from Doppler. all secrets will be read directly from the fallback file")
runCmd.Flags().Bool("fallback-readonly", false, "do not update or modify the fallback file. [requires --fallback]")
runCmd.Flags().Bool("fallback-only", false, "do not request secrets from Doppler. all secrets will be read directly from the fallback file. [requires --fallback]")

rootCmd.AddCommand(runCmd)
}
12 changes: 11 additions & 1 deletion pkg/utils/util.go
Original file line number Diff line number Diff line change
@@ -21,6 +21,7 @@ import (
"path/filepath"
"runtime"
"strconv"
"strings"
"time"

"github.com/AlecAivazis/survey/v2"
@@ -67,7 +68,12 @@ func Cwd() string {

// RunCommand runs the specified command
func RunCommand(command []string, env []string) (int, error) {
cmd := exec.Command(command[0], command[1:]...)
shell := [2]string{"sh", "-c"}
if IsWindows() {
shell = [2]string{"cmd", "/C"}
}

cmd := exec.Command(shell[0], shell[1], strings.Join(command, " "))
cmd.Env = env
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
@@ -215,3 +221,7 @@ func HostArch() string {

return arch
}

func IsWindows() bool {
return runtime.GOOS == "windows"
}

0 comments on commit 1e16d62

Please sign in to comment.