Skip to content

[Bug]: Cannot use literal ${x} in environment variable files #6491

Open
@lukpsaxo

Description

@lukpsaxo

Self-service

  • I'd be willing to implement a fix

Describe the bug

If your env variable needs to have a value with ${} in it, yarn will error:

Usage Error: Environment variable not found (endpoint)

To reproduce

create a env file with:

CYPRESS_DOWNLOAD_PATH_TEMPLATE="${endpoint}/${platform}-${arch}/cypress.zip"

Environment

windows

Additional context

the problem is here:

export function replaceEnvVariables(value: string, {env}: {env: {[key: string]: string | undefined}}) {

I think it just needs a negative look behind for an escaping \ - which would match the behaviour of npm and setting variables in npmrc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions