Skip to content

Env var SRC_ENDPOINT is ignored when config file exists #222

@sqs

Description

@sqs

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions