@@ -52,14 +52,14 @@ func (a *AuthConfig) UnmarshalJSON(data []byte) error {
52
52
}
53
53
54
54
type CLIConfig struct {
55
- Auths map [string ]AuthConfig `json:"auths,omitempty"`
56
- CredentialsStore string `json:"credsStore,omitempty"`
57
- GPTScriptConfigFile string `json:"gptscriptConfig,omitempty"`
58
- GatewayURL string `json:"gatewayURL,omitempty"`
59
- Integrations map [string ]string `json:"integrations,omitempty"`
55
+ Auths map [string ]AuthConfig `json:"auths,omitempty"`
56
+ CredentialsStore string `json:"credsStore,omitempty"`
57
+ GatewayURL string `json:"gatewayURL,omitempty"`
58
+ Integrations map [string ]string `json:"integrations,omitempty"`
60
59
61
60
auths map [string ]types.AuthConfig
62
61
authsLock * sync.Mutex
62
+ location string
63
63
}
64
64
65
65
func (c * CLIConfig ) Sanitize () * CLIConfig {
@@ -93,7 +93,7 @@ func (c *CLIConfig) Save() error {
93
93
if err != nil {
94
94
return err
95
95
}
96
- return os .WriteFile (c .GPTScriptConfigFile , data , 0655 )
96
+ return os .WriteFile (c .location , data , 0655 )
97
97
}
98
98
99
99
func (c * CLIConfig ) GetAuthConfigs () map [string ]types.AuthConfig {
@@ -113,7 +113,7 @@ func (c *CLIConfig) GetAuthConfigs() map[string]types.AuthConfig {
113
113
}
114
114
115
115
func (c * CLIConfig ) GetFilename () string {
116
- return c .GPTScriptConfigFile
116
+ return c .location
117
117
}
118
118
119
119
func ReadCLIConfig (gptscriptConfigFile string ) (* CLIConfig , error ) {
@@ -133,8 +133,8 @@ func ReadCLIConfig(gptscriptConfigFile string) (*CLIConfig, error) {
133
133
return nil , err
134
134
}
135
135
result := & CLIConfig {
136
- authsLock : & sync.Mutex {},
137
- GPTScriptConfigFile : gptscriptConfigFile ,
136
+ authsLock : & sync.Mutex {},
137
+ location : gptscriptConfigFile ,
138
138
}
139
139
if err := json .Unmarshal (data , result ); err != nil {
140
140
return nil , err
@@ -158,7 +158,7 @@ func ReadCLIConfig(gptscriptConfigFile string) (*CLIConfig, error) {
158
158
default :
159
159
errMsg += " (use 'file')"
160
160
}
161
- errMsg += fmt .Sprintf ("\n Please edit your config file at %s to fix this." , result .GPTScriptConfigFile )
161
+ errMsg += fmt .Sprintf ("\n Please edit your config file at %s to fix this." , result .location )
162
162
163
163
return nil , errors .New (errMsg )
164
164
}
0 commit comments