Skip to content

Commit 62d9851

Browse files
authored
Revert "Fix URL in no token error message (#1166)" (#1173)
This reverts commit 102aeb8.
1 parent c3738a8 commit 62d9851

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

cmd/download_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func TestDownloadWithoutToken(t *testing.T) {
2626
if assert.Error(t, err) {
2727
assert.Regexp(t, "Welcome to Exercism", err.Error())
2828
// It uses the default base API url to infer the host
29-
assert.Regexp(t, "exercism.org/settings/api_cli", err.Error())
29+
assert.Regexp(t, "exercism.io/my/settings", err.Error())
3030
}
3131
}
3232

cmd/submit_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func TestSubmitWithoutToken(t *testing.T) {
2828
err := runSubmit(cfg, pflag.NewFlagSet("fake", pflag.PanicOnError), []string{})
2929
if assert.Error(t, err) {
3030
assert.Regexp(t, "Welcome to Exercism", err.Error())
31-
assert.Regexp(t, "exercism.org/settings/api_cli", err.Error())
31+
assert.Regexp(t, "exercism.io/my/settings", err.Error())
3232
}
3333
}
3434

config/config.go

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

1414
var (
15-
defaultBaseURL = "https://exercism.org"
15+
defaultBaseURL = "https://api.exercism.io/v1"
1616

1717
// DefaultDirName is the default name used for config and workspace directories.
1818
DefaultDirName string
@@ -122,13 +122,13 @@ func InferSiteURL(apiURL string) string {
122122
apiURL = defaultBaseURL
123123
}
124124
if apiURL == "https://api.exercism.io/v1" {
125-
return "https://exercism.org"
125+
return "https://exercism.io"
126126
}
127127
re := regexp.MustCompile("^(https?://[^/]*).*")
128128
return re.ReplaceAllString(apiURL, "$1")
129129
}
130130

131131
// SettingsURL provides a link to where the user can find their API token.
132132
func SettingsURL(apiURL string) string {
133-
return fmt.Sprintf("%s%s", InferSiteURL(apiURL), "/settings/api_cli")
133+
return fmt.Sprintf("%s%s", InferSiteURL(apiURL), "/my/settings")
134134
}

config/config_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ func TestInferSiteURL(t *testing.T) {
1010
testCases := []struct {
1111
api, url string
1212
}{
13-
{"https://api.exercism.io/v1", "https://exercism.org"},
13+
{"https://api.exercism.io/v1", "https://exercism.io"},
1414
{"https://v2.exercism.io/api/v1", "https://v2.exercism.io"},
1515
{"https://mentors-beta.exercism.io/api/v1", "https://mentors-beta.exercism.io"},
1616
{"http://localhost:3000/api/v1", "http://localhost:3000"},
17-
{"", "https://exercism.org"}, // use the default
17+
{"", "https://exercism.io"}, // use the default
1818
{"http://whatever", "http://whatever"}, // you're on your own, pal
1919
}
2020

0 commit comments

Comments
 (0)