If ~/src-config.json exists, the env var SRC_ENDPOINT is ignored (see https://sourcegraph.com/github.com/sourcegraph/src-cli@6f6674f8e67e380efe64cd53662f342cd4604a74/-/blob/cmd/src/main.go#L106). This is confusing. Also, SRC_ACCESS_TOKEN behaves in the opposite way; it overrides the value set in the config file.
I believe the ideal behavior is:
- Both env vars override the config file.
- If a config file exists, either zero or both env vars must be specified. It is an error if only one is specified. This is to avoid confusion; we never merge config from the file and env vars.
Reported by @nicksnyder in https://sourcegraph.slack.com/archives/CMMTWQQ49/p1591657309056300.
If
~/src-config.jsonexists, the env varSRC_ENDPOINTis ignored (see https://sourcegraph.com/github.com/sourcegraph/src-cli@6f6674f8e67e380efe64cd53662f342cd4604a74/-/blob/cmd/src/main.go#L106). This is confusing. Also,SRC_ACCESS_TOKENbehaves in the opposite way; it overrides the value set in the config file.I believe the ideal behavior is:
Reported by @nicksnyder in https://sourcegraph.slack.com/archives/CMMTWQQ49/p1591657309056300.