Skip to content

Inconsistent variable expansion in arguments Win VS Linux #343

Description

@b12k

Hello, thank you for a great lib 🤘

I'm facing a problem related to environment variables expansion on Windows and Linux (Github Actions)

I use env-cmd in package.json scripts.

.env

VAR=Hello World

package.json

{
  "name": "env-cmd-bug",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "scripts": {
    "unescaped": "env-cmd -x --verbose echo $VAR",
    "escaped": "env-cmd -x --verbose echo \\$VAR"
  },
  "dependencies": {
    "env-cmd": "^10.1.0"
  }
}

Escaping the $ sign works for Linux, but fails on Windows.

Outputs:

Ubuntu
изображение

Windows
изображение

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions