Skip to content

{PDM_RUN_CWD} placeholder in scripts? #3734

@paugier

Description

@paugier

Feature Description

For a project, we use

[tool.pdm.scripts]
create-symlinks = {shell = "python tools/create_symlinks.py $PDM_RUN_CWD"}

However, this solution is not cross-plateform since $PDM_RUN_CWD does not work on Windows.

Could we have a cross-platform solution, maybe something like

create-symlinks = {shell = "python tools/create_symlinks.py {PDM_RUN_CWD}"}

(inspired by {pdm} https://pdm-project.org/latest/usage/scripts/#pdm-placeholder)

Of course, for this particular case, we could also just make create_symlinks.py aware of $PDM_RUN_CWD but it would be less general for us and I would prefer to keep the things related to PDM in PDM scripts.

Problem and Solution

create-symlinks = {shell = "python tools/create_symlinks.py $PDM_RUN_CWD"} is not cross-platform.

Additional Context

No response

Are you willing to contribute to the development of this feature?

  • Yes, I am willing to contribute to the development of this feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ⭐ enhancementImprovements for existing features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions