Skip to content

Commit e2d91cd

Browse files
committed
Rename SCW_API_ env variable to SCW_TOKEN and SCW_ORGANIZATION
1 parent 3d25fe3 commit e2d91cd

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

pkg/config/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ func (c *Config) Save(configPath string) error {
5757
func GetConfig(scwrcPath string) (*Config, error) {
5858
var err error
5959

60-
orgid := os.Getenv("SCW_API_ORGID")
61-
token := os.Getenv("SCW_API_TOKEN")
60+
orgid := os.Getenv("SCW_ORGANIZATION")
61+
token := os.Getenv("SCW_TOKEN")
6262
if token != "" && orgid != "" {
6363
cfg := Config{
6464
Organization: strings.Trim(orgid, "\n"),

pkg/config/config_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@ func TestGetConfig(t *testing.T) {
5858
So(err, ShouldBeNil)
5959
So(cfg.Organization, ShouldEqual, randOrg)
6060
So(cfg.Token, ShouldEqual, randToken)
61-
os.Setenv("SCW_API_ORGID", randOrg)
62-
os.Setenv("SCW_API_TOKEN", randToken)
61+
os.Setenv("SCW_ORGANIZATION", randOrg)
62+
os.Setenv("SCW_TOKEN", randToken)
6363
cfg, err = GetConfig("")
6464
So(err, ShouldBeNil)
6565
So(cfg.Organization, ShouldEqual, randOrg)
6666
So(cfg.Token, ShouldEqual, randToken)
67-
os.Unsetenv("SCW_API_ORGID")
68-
os.Unsetenv("SCW_API_TOKEN")
67+
os.Unsetenv("SCW_ORGANIZATION")
68+
os.Unsetenv("SCW_TOKEN")
6969
})
7070
}
7171

0 commit comments

Comments
 (0)