Skip to content
Discussion options

You must be logged in to vote

For this particular package.json case, I would use varlock printenv or put the shell expansion inside the command that varlock run starts.

The direct form is:

{
  "scripts": {
    "test:e2e:ui": "playwright install && playwright test --ui-host=0.0.0.0 --ui-port=$(varlock printenv LEWP_PLAYWRIGHT)"
  }
}

printenv is meant for exactly this kind of shell interpolation: it prints one resolved variable, and the command spec also supports --path / -p if you need to point at a specific env file or directory.

If you prefer to inject the whole resolved environment into the Playwright process, keep the expansion inside a child shell after varlock run has injected the variables:

{
  "scripts": {
    "…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by unikitty37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants