pdm icon indicating copy to clipboard operation
pdm copied to clipboard

Support for output redirect + os-independent environment variable substitution in `cmd`

Open schwaerz opened this issue 1 year ago • 1 comments

We are trying to use pdm as a wrapper to Conan projects.

What we are doing is:

  • Install Conan and other tools using python packages
  • Define aliases for most commonly used commands (as an alternative to dedicated scripts)
  • Some of the commands need both environment variable subsitution as well as redirecting the output into a file

Currently I have the choice between cmd and shell. AFAIK only with shell I can redirect the output. However I cannot use shell as I'd have a different command line wrt to using environment variables %VAR% vs ${VAR}, depending on the OS.

Describe the solution you'd like

  • Possbility to redirect the output as part of cmd into a file

schwaerz avatar Jun 12 '24 13:06 schwaerz

We found following workaround:

my_script.shell = "bash -c \"echo ${VAR}\""

schwaerz avatar Jun 12 '24 13:06 schwaerz