Skip to content

joinEnv - Just like joinPath but with ; for windows else : #2406

@solvingj

Description

@solvingj

Description

Title basically says it all. Once it's possible to prepend paths to the PATH via env (ideally fixed in #2034) , it should have a native cross-platform syntax for doing it cleanly on windows or posix platforms.

env:
    PATH: "{{joinEnv "{{.TASKFILE_DIR}}/tools/bin" .PATH}}"

or perhaps

env:
    BIN_DIR: "{{joinPath {{.TASKFILE_DIR}} "tools" "bin"}}"
    PATH: "{{joinEnv .BIN_DIR .PATH}}"

Additionally, or alternatively, add a special variable: PATHSEP for platform specific path separation in env vars.

env:
    PATH: "{{{{.TASKFILE_DIR}}/tools/bin{{.PATHSEP}}{{.PATH}}"

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: templatingChanges related to the templating engine.good first issueIssues that are good for first-time contributors to pick up.os: windowsIssues that affect users on Windows.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions