diff --git a/cmd/login.go b/cmd/login.go index ad9d1f6..f15d335 100644 --- a/cmd/login.go +++ b/cmd/login.go @@ -107,7 +107,7 @@ func executeLogin(args []string, getHome func() (string, pkg.ConfFiles, error), } switch { case authToken != "": - if err := makeConf(confDir, pkg.PathWithEnv(confFiles.TokenPath), authToken); err != nil { + if err := makeConf(confDir, confFiles.TokenPath, authToken); err != nil { return WriteError, err } return 0, nil @@ -133,7 +133,7 @@ func executeLogin(args []string, getHome func() (string, pkg.ConfFiles, error), } } clientJSON = fmt.Sprintf("{\"clientId\":\"%v\",\"clientName\":\"%v\",\"clientSecret\":\"%v\"}", clientID, clientName, clientSecret) - if err := makeConf(confDir, pkg.PathWithEnv(confFiles.SaPath), clientJSON); err != nil { + if err := makeConf(confDir, confFiles.SaPath, clientJSON); err != nil { return WriteError, err } return 0, nil diff --git a/cmd/login_test.go b/cmd/login_test.go index c8428c3..55ee602 100644 --- a/cmd/login_test.go +++ b/cmd/login_test.go @@ -127,7 +127,7 @@ func TestArgs(t *testing.T) { if exitCode != 0 { t.Fatalf("unexpected exit code %v", exitCode) } - fd, err := os.Open(pkg.PathWithEnv(f)) + fd, err := os.Open(f) if err != nil { t.Fatalf("unexpected error %v", err) } @@ -175,7 +175,7 @@ func TestArgsWithNoPermission(t *testing.T) { if exitCode != WriteError { t.Errorf("unexpected exit code %v", exitCode) } - expected := fmt.Sprintf("unable to create the login file due to error open %v: permission denied", pkg.PathWithEnv(f)) + expected := fmt.Sprintf("unable to create the login file due to error open %v: permission denied", f) if err.Error() != expected { t.Errorf("expected '%v' but was '%v'", expected, err.Error()) } @@ -390,7 +390,7 @@ func TestLoginToken(t *testing.T) { if exitCode != 0 { t.Fatalf("unexpected exit code %v", exitCode) } - fd, err := os.Open(pkg.PathWithEnv(f)) + fd, err := os.Open(f) if err != nil { t.Fatalf("unexpected error %v", err) } @@ -431,7 +431,7 @@ func TestLoginTokenInvalidPerms(t *testing.T) { if exitCode != WriteError { t.Errorf("unexpected exit code %v", exitCode) } - expected := fmt.Sprintf("unable to create the login file due to error open %v: permission denied", pkg.PathWithEnv(f)) + expected := fmt.Sprintf("unable to create the login file due to error open %v: permission denied", f) if err.Error() != expected { t.Errorf("expected '%v' but was '%v'", expected, err.Error()) }