nrwl/nx

Replacing the value of an environment variable when outputting to the console

khludenevav opened this issue · 1 comments

Current Behavior

Call of target shows env variable

 "recreate-storyshots": {
      "executor": "nx:run-commands",
      "options": {
        "commands": [
          "rm -rf {projectRoot}/storyshots",
          "nx run $NX_TASK_TARGET_PROJECT:test:storyshots --nx-skip-cache"
        ],
        "parallel": false
      }
    },

image

Expected Behavior

Expected to show project name like
nx run docs:test:storyshots --nx-skip-cache

GitHub Repo

No response

Steps to Reproduce

I'm swtiching from 18.0.5 to 19.0.4

Nx Report

NX   Report complete - copy this into the issue template

Node   : 20.10.0
OS     : darwin-arm64
pnpm   : 9.1.0

nx (global)        : 19.0.4
nx                 : 19.0.4
@nx/js             : 19.0.4
@nx/jest           : 19.0.4
@nx/eslint         : 19.0.4
@nx/workspace      : 19.0.4
@nx/devkit         : 19.0.4
@nx/eslint-plugin  : 19.0.4
@nx/next           : 19.0.4
@nx/plugin         : 19.0.4
@nx/react          : 19.0.4
@nx/storybook      : 19.0.4
@nx/web            : 19.0.4
typescript         : 5.4.5
---------------------------------------
Registered Plugins:
nx-plugin

Failure Logs

No response

Package Manager Version

No response

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

Mm, the command shown there is the actual command that is being run... which does not have the environment variable evaluated. The shell takes care of that.

However, if you use {projectName} that one should be interpolated.