Skip to content

When env vars have different value depending on case, throw error #543

@nedtwigg

Description

@nedtwigg

This has the confusing behavior that variables with a lowercase key trump an uppercase key

internal fun calcMode(): Mode {
val override = lowercaseFromEnvOrSys("selfie") ?: lowercaseFromEnvOrSys("SELFIE")
if (override != null) {
return Mode.valueOf(override)
}
val ci = lowercaseFromEnvOrSys("ci") ?: lowercaseFromEnvOrSys("CI")
return if (ci == "true") Mode.readonly else Mode.interactive
}

I think it's good to be case-insensitive, but if both variables exist and disagree it should generate an easy-to-understand error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingjvmpy

    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