From e83887aac77e29d19bb61d754c0056c17418938c Mon Sep 17 00:00:00 2001 From: Jacob Bednarz Date: Thu, 17 Sep 2020 09:24:15 +1000 Subject: [PATCH] use default keychain configuration --- cmd/exec.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmd/exec.go b/cmd/exec.go index 8ee5d85..2dd8c98 100644 --- a/cmd/exec.go +++ b/cmd/exec.go @@ -53,9 +53,6 @@ var execCmd = &cobra.Command{ log.Fatal(fmt.Sprintf("no profile matching %q found in the configuration file at %s", profileName, defaultFullConfigPath)) } - ring, _ := keyring.Open(keyringDefaults) - - keychain, _ := ring.Get(fmt.Sprintf("%s-%s", profileName, profileSection.Key("auth_type").String())) command := strings.Split(args[1], " ") executable := command[0] @@ -64,6 +61,8 @@ var execCmd = &cobra.Command{ log.Fatalf("couldn't find the executable '%s': %w", executable, err) } + ring, _ := keyring.Open(keyringDefaults) + keychain, _ := ring.Get(fmt.Sprintf("%s-%s", profileName, profileSection.Key("auth_type").String())) runningCommand := exec.Command(executable, args...) runningCommand.Env = append(os.Environ(),