File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -58,13 +58,13 @@ Consult `src -h` and `src api -h` for usage information.
5858Some Sourcegraph instances will be configured to require authentication. You can do so via the environment:
5959
6060``` sh
61- SRC_ACCESS_TOKEN=" secret" src ...
61+ SRC_ENDPOINT=https://sourcegraph.example.com SRC_ACCESS_TOKEN=" secret" src ...
6262```
6363
6464Or via the configuration file (` ~/src-config.json ` ):
6565
6666``` sh
67- {" accessToken" : " secret" }
67+ {" accessToken" : " secret" , " endpoint " : " https://sourcegraph.example.com " }
6868```
6969
7070See ` src -h ` for more information on specifying access tokens.
Original file line number Diff line number Diff line change @@ -91,6 +91,11 @@ func readConfig() (*config, error) {
9191 if * endpoint != "" {
9292 cfg .Endpoint = strings .TrimSuffix (* endpoint , "/" )
9393 }
94+ if cfg .Endpoint == "" {
95+ if endpoint := os .Getenv ("SRC_ENDPOINT" ); endpoint != "" {
96+ cfg .Endpoint = endpoint
97+ }
98+ }
9499 if cfg .Endpoint == "" {
95100 cfg .Endpoint = "https://sourcegraph.com"
96101 }
You can’t perform that action at this time.
0 commit comments