Skip to content

Commit 885a1d2

Browse files
committed
minor improvements
1 parent e23f8e9 commit 885a1d2

File tree

3 files changed

+33
-35
lines changed

3 files changed

+33
-35
lines changed

cmd/root.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -285,24 +285,24 @@ func isLoadSettings(cmd *cobra.Command) bool {
285285
func isLoadCredentials(cmd *cobra.Command) bool {
286286
// It is not expected to have the credentials loaded when running the following commands
287287
var excludedCommands = map[string]struct{}{
288-
"cre version": {},
289-
"cre login": {},
290-
"cre completion bash": {},
291-
"cre completion fish": {},
292-
"cre completion powershell": {},
293-
"cre completion zsh": {},
294-
"cre help": {},
295-
"cre generate-bindings": {},
296-
"cre update": {},
297-
"cre workflow": {},
298-
"cre account": {},
299-
"cre profile": {},
300-
"cre profile list": {},
301-
"cre profile use": {},
302-
"cre profile delete": {},
303-
"cre profile rename": {},
304-
"cre secrets": {},
305-
"cre": {},
288+
"cre version": {},
289+
"cre login": {},
290+
"cre completion bash": {},
291+
"cre completion fish": {},
292+
"cre completion powershell": {},
293+
"cre completion zsh": {},
294+
"cre help": {},
295+
"cre generate-bindings": {},
296+
"cre update": {},
297+
"cre workflow": {},
298+
"cre account": {},
299+
"cre profile": {},
300+
"cre profile list": {},
301+
"cre profile use": {},
302+
"cre profile delete": {},
303+
"cre profile rename": {},
304+
"cre secrets": {},
305+
"cre": {},
306306
}
307307

308308
_, exists := excludedCommands[cmd.CommandPath()]

internal/profiles/profiles.go

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,29 @@ import (
1212
)
1313

1414
const (
15-
ConfigDir = ".cre"
16-
ProfilesFile = "profiles.yaml"
17-
LegacyFile = "cre.yaml" // for backwards compatibility
15+
ConfigDir = ".cre"
16+
ProfilesFile = "profiles.yaml"
17+
LegacyFile = "cre.yaml" // for backwards compatibility
1818
)
1919

2020
// Profile represents a single account/organization profile
2121
type Profile struct {
22-
Name string `yaml:"name"`
23-
Org string `yaml:"org,omitempty"` // organization name for reference
24-
OrgID string `yaml:"org_id,omitempty"`
25-
Email string `yaml:"email,omitempty"`
26-
Tokens *credentials.CreLoginTokenSet `yaml:"tokens,omitempty"`
27-
APIKey string `yaml:"api_key,omitempty"`
28-
AuthType string `yaml:"auth_type,omitempty"`
29-
CreatedAt string `yaml:"created_at,omitempty"`
30-
UpdatedAt string `yaml:"updated_at,omitempty"`
22+
Name string `yaml:"name"`
23+
Org string `yaml:"org,omitempty"` // organization name for reference
24+
OrgID string `yaml:"org_id,omitempty"`
25+
Email string `yaml:"email,omitempty"`
26+
Tokens *credentials.CreLoginTokenSet `yaml:"tokens,omitempty"`
27+
APIKey string `yaml:"api_key,omitempty"`
28+
AuthType string `yaml:"auth_type,omitempty"`
29+
CreatedAt string `yaml:"created_at,omitempty"`
30+
UpdatedAt string `yaml:"updated_at,omitempty"`
3131
}
3232

3333
// ProfilesConfig represents the entire profiles configuration
3434
type ProfilesConfig struct {
35-
Version string `yaml:"version"`
36-
ActiveProfile string `yaml:"active_profile"`
37-
Profiles []*Profile `yaml:"profiles"`
35+
Version string `yaml:"version"`
36+
ActiveProfile string `yaml:"active_profile"`
37+
Profiles []*Profile `yaml:"profiles"`
3838
}
3939

4040
// Manager handles profile operations
@@ -282,4 +282,3 @@ func (m *Manager) GetProfileByOrgID(orgID string) *Profile {
282282
func (m *Manager) GetActiveProfileName() string {
283283
return m.config.ActiveProfile
284284
}
285-

internal/profiles/profiles_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,4 +153,3 @@ func TestProfileManager(t *testing.T) {
153153
}
154154
})
155155
}
156-

0 commit comments

Comments
 (0)