Skip to content

Commit 66bf50f

Browse files
committed
Delete deprecated key names on config
1 parent 4efae44 commit 66bf50f

3 files changed

Lines changed: 1 addition & 25 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* [#151](https://github.com/exercism/cli/pull/151): Expand '~' in config path to home directory - [@lcowell](https://github.com/lcowell)
66
* Stop supporting legacy config files (~/.exercism.go)
77
* Deleted deprecated login/logout commands
8+
* Deleted deprecated key names in config
89
* Your contribution here
910

1011
## v1.9.2 (Jan 11, 2015)

‎config/config.go‎

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@ type Config struct {
4343
XAPI string `json:"xapi"`
4444
File string `json:"-"` // full path to config file
4545
home string // cache user's home directory
46-
47-
// deprecated, get rid of them when nobody uses 1.7.0 anymore
48-
ExercismDirectory string `json:"exercismDirectory,omitempty"`
49-
Hostname string `json:"hostname,omitempty"`
50-
ProblemsHost string `json:"problemsHost,omitempty"`
5146
}
5247

5348
// Home returns the user's canonical home directory.
@@ -149,10 +144,6 @@ func (c *Config) Read(file string) error {
149144

150145
// Write() saves the config as JSON.
151146
func (c *Config) Write() error {
152-
c.ExercismDirectory = ""
153-
c.Hostname = ""
154-
c.ProblemsHost = ""
155-
156147
// truncates existing file if it exists
157148
f, err := os.Create(c.File)
158149
if err != nil {
@@ -167,18 +158,10 @@ func (c *Config) Write() error {
167158
func (c *Config) configure() (*Config, error) {
168159
c.sanitize()
169160

170-
if c.Hostname != "" {
171-
c.API = c.Hostname
172-
}
173-
174161
if c.API == "" {
175162
c.API = hostAPI
176163
}
177164

178-
if c.ProblemsHost != "" {
179-
c.XAPI = c.ProblemsHost
180-
}
181-
182165
if c.XAPI == "" {
183166
c.XAPI = hostXAPI
184167
}
@@ -188,11 +171,6 @@ func (c *Config) configure() (*Config, error) {
188171
return c, err
189172
}
190173

191-
// use legacy value, if it exists
192-
if c.ExercismDirectory != "" {
193-
c.Dir = c.ExercismDirectory
194-
}
195-
196174
if c.Dir == "" {
197175
// fall back to default value
198176
c.Dir = filepath.Join(homeDir, DirExercises)
@@ -228,6 +206,4 @@ func (c *Config) sanitize() {
228206
c.Dir = strings.TrimSpace(c.Dir)
229207
c.API = strings.TrimSpace(c.API)
230208
c.XAPI = strings.TrimSpace(c.XAPI)
231-
c.Hostname = strings.TrimSpace(c.Hostname)
232-
c.ProblemsHost = strings.TrimSpace(c.ProblemsHost)
233209
}

‎fixtures/home/legacy.json‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)