You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
createAccessTokenMessage:=fmt.Sprintf("\n"+`🛠 To fix: Create an access token at %s/user/settings/tokens, then set the following environment variables:
74
+
createAccessTokenMessage:=fmt.Sprintf("\n"+`🛠 To fix: Create an access token by going to %s/user/settings/tokens, then set the following environment variables in your terminal:
75
75
76
-
SRC_ENDPOINT=%s
77
-
SRC_ACCESS_TOKEN=(the access token you just created)
76
+
export SRC_ENDPOINT=%s
77
+
export SRC_ACCESS_TOKEN=(your access token)
78
78
79
-
To verify that it's working, run this command again.
79
+
To verify that it's working, run the login command again.
Copy file name to clipboardExpand all lines: cmd/src/login_test.go
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ func TestLogin(t *testing.T) {
27
27
iferr!=cmderrors.ExitCode1 {
28
28
t.Fatal(err)
29
29
}
30
-
wantOut:="❌ Problem: No access token is configured.\n\n🛠 To fix: Create an access token at https://sourcegraph.example.com/user/settings/tokens, then set the following environment variables:\n\n SRC_ENDPOINT=https://sourcegraph.example.com\n SRC_ACCESS_TOKEN=(the access token you just created)\n\n To verify that it's working, run this command again."
30
+
wantOut:="❌ Problem: No access token is configured.\n\n🛠 To fix: Create an access token by going to https://sourcegraph.example.com/user/settings/tokens, then set the following environment variables in your terminal:\n\nexport SRC_ENDPOINT=https://sourcegraph.example.com\nexport SRC_ACCESS_TOKEN=(your access token)\n\n To verify that it's working, run the login command again."
31
31
ifout!=wantOut {
32
32
t.Errorf("got output %q, want %q", out, wantOut)
33
33
}
@@ -38,7 +38,7 @@ func TestLogin(t *testing.T) {
38
38
iferr!=cmderrors.ExitCode1 {
39
39
t.Fatal(err)
40
40
}
41
-
wantOut:="❌ Problem: No access token is configured.\n\n🛠 To fix: Create an access token at https://sourcegraph.example.com/user/settings/tokens, then set the following environment variables:\n\n SRC_ENDPOINT=https://sourcegraph.example.com\n SRC_ACCESS_TOKEN=(the access token you just created)\n\n To verify that it's working, run this command again."
41
+
wantOut:="❌ Problem: No access token is configured.\n\n🛠 To fix: Create an access token by going to https://sourcegraph.example.com/user/settings/tokens, then set the following environment variables in your terminal:\n\nexport SRC_ENDPOINT=https://sourcegraph.example.com\nexport SRC_ACCESS_TOKEN=(your access token)\n\n To verify that it's working, run the login command again."
42
42
ifout!=wantOut {
43
43
t.Errorf("got output %q, want %q", out, wantOut)
44
44
}
@@ -49,7 +49,7 @@ func TestLogin(t *testing.T) {
49
49
iferr!=cmderrors.ExitCode1 {
50
50
t.Fatal(err)
51
51
}
52
-
wantOut:="⚠️ Warning: Configuring src with a JSON file is deprecated. Please migrate to using the env vars SRC_ENDPOINT, SRC_ACCESS_TOKEN, and SRC_PROXY instead, and then remove f. See https://github.com/sourcegraph/src-cli#readme for more information.\n\n❌ Problem: No access token is configured.\n\n🛠 To fix: Create an access token at https://example.com/user/settings/tokens, then set the following environment variables:\n\n SRC_ENDPOINT=https://example.com\n SRC_ACCESS_TOKEN=(the access token you just created)\n\n To verify that it's working, run this command again."
52
+
wantOut:="⚠️ Warning: Configuring src with a JSON file is deprecated. Please migrate to using the env vars SRC_ENDPOINT, SRC_ACCESS_TOKEN, and SRC_PROXY instead, and then remove f. See https://github.com/sourcegraph/src-cli#readme for more information.\n\n❌ Problem: No access token is configured.\n\n🛠 To fix: Create an access token by going to https://example.com/user/settings/tokens, then set the following environment variables in your terminal:\n\nexport SRC_ENDPOINT=https://example.com\nexport SRC_ACCESS_TOKEN=(your access token)\n\n To verify that it's working, run the login command again."
53
53
ifout!=wantOut {
54
54
t.Errorf("got output %q, want %q", out, wantOut)
55
55
}
@@ -67,7 +67,7 @@ func TestLogin(t *testing.T) {
67
67
iferr!=cmderrors.ExitCode1 {
68
68
t.Fatal(err)
69
69
}
70
-
wantOut:="❌ Problem: Invalid access token.\n\n🛠 To fix: Create an access token at $ENDPOINT/user/settings/tokens, then set the following environment variables:\n\n SRC_ENDPOINT=$ENDPOINT\n SRC_ACCESS_TOKEN=(the access token you just created)\n\n To verify that it's working, run this command again.\n\n (If you need to supply custom HTTP request headers, see information about SRC_HEADER_* and SRC_HEADERS env vars at https://github.com/sourcegraph/src-cli/blob/main/AUTH_PROXY.md.)"
70
+
wantOut:="❌ Problem: Invalid access token.\n\n🛠 To fix: Create an access token by going to $ENDPOINT/user/settings/tokens, then set the following environment variables in your terminal:\n\nexport SRC_ENDPOINT=$ENDPOINT\nexport SRC_ACCESS_TOKEN=(your access token)\n\n To verify that it's working, run the login command again.\n\n (If you need to supply custom HTTP request headers, see information about SRC_HEADER_* and SRC_HEADERS env vars at https://github.com/sourcegraph/src-cli/blob/main/AUTH_PROXY.md.)"
0 commit comments