Skip to content

Conversation

parksb
Copy link

@parksb parksb commented Oct 7, 2025

What's the problem this PR addresses?

Resolves #6491

$ yarn init -2
$ echo 'CYPRESS_DOWNLOAD_PATH_TEMPLATE="\${endpoint}/\${platform}-\${arch}/cypress.zip"' > .env.yarn
$ yarn node -p 'process.env.CYPRESS_DOWNLOAD_PATH_TEMPLATE'

# AS-IS
Usage Error: Environment variable not found (endpoint)

# TO-BE
${endpoint}/${platform}-${arch}/cypress.zip

How did you fix it?

Support escaping template variables in environment variable values. When a template variable is escaped with a backslash (e.g., \${VAR}), it is now preserved as a literal string ${VAR} instead of being replaced with an actual environment variable value.

I updated the regex to match values starting with a backslash. When a match starts with a backslash, it is treated as an escaped template and returns the value with only the backslash removed (match.slice(1)).

Checklist

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant