Skip to content

Commit e6672ec

Browse files
committed
Merge pull request #153 from exercism/refactor-config
Refactor config
2 parents c37cdbe + 7f5be84 commit e6672ec

16 files changed

Lines changed: 180 additions & 199 deletions

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Stop supporting legacy config files (~/.exercism.go)
77
* Deleted deprecated login/logout commands
88
* Deleted deprecated key names in config
9+
* [#153](https://github.com/exercism/cli/pull/153): Refactored configuration package - [@kytrinyx](https://github.com/kytrinyx)
910
* Your contribution here
1011

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

cmd/configure.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
// If a setting is not passed as an argument, default
1414
// values are used.
1515
func Configure(ctx *cli.Context) {
16-
c, err := config.Read(ctx.GlobalString("config"))
16+
c, err := config.New(ctx.GlobalString("config"))
1717
if err != nil {
1818
log.Fatal(err)
1919
}

cmd/debug.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ func Debug(ctx *cli.Context) {
2424
}
2525
fmt.Printf("Home Dir: %s\n", dir)
2626

27-
c, err := config.Read(ctx.GlobalString("config"))
27+
c, err := config.New(ctx.GlobalString("config"))
2828
if err != nil {
2929
log.Fatal(err)
3030
}

cmd/demo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
// Demo returns one problem for each active track.
1414
func Demo(ctx *cli.Context) {
15-
c, err := config.Read(ctx.GlobalString("config"))
15+
c, err := config.New(ctx.GlobalString("config"))
1616
if err != nil {
1717
log.Fatal(err)
1818
}

cmd/download.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414

1515
// Download returns specified submissions and related problem.
1616
func Download(ctx *cli.Context) {
17-
c, err := config.Read(ctx.GlobalString("config"))
17+
c, err := config.New(ctx.GlobalString("config"))
1818
if err != nil {
1919
log.Fatal(err)
2020
}

cmd/fetch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
// Fetch returns exercism problems.
1414
func Fetch(ctx *cli.Context) {
15-
c, err := config.Read(ctx.GlobalString("config"))
15+
c, err := config.New(ctx.GlobalString("config"))
1616
if err != nil {
1717
log.Fatal(err)
1818
}

cmd/restore.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
// Restore returns a user's solved problems.
1414
func Restore(ctx *cli.Context) {
15-
c, err := config.Read(ctx.GlobalString("config"))
15+
c, err := config.New(ctx.GlobalString("config"))
1616
if err != nil {
1717
log.Fatal(err)
1818
}

cmd/submit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func Submit(ctx *cli.Context) {
1818
log.Fatal("Please enter a file name")
1919
}
2020

21-
c, err := config.Read(ctx.GlobalString("config"))
21+
c, err := config.New(ctx.GlobalString("config"))
2222
if err != nil {
2323
log.Fatal(err)
2424
}

cmd/tracks.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
// Tracks lists available tracks.
1414
func Tracks(ctx *cli.Context) {
15-
c, err := config.Read(ctx.GlobalString("config"))
15+
c, err := config.New(ctx.GlobalString("config"))
1616
if err != nil {
1717
log.Fatal(err)
1818
}

cmd/unsubmit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
// If no iteration is specified, the most recent iteration
1414
// is deleted.
1515
func Unsubmit(ctx *cli.Context) {
16-
c, err := config.Read(ctx.GlobalString("config"))
16+
c, err := config.New(ctx.GlobalString("config"))
1717
if err != nil {
1818
log.Fatal(err)
1919
}

0 commit comments

Comments
 (0)