Skip to content

templater: add joinEnv helper for PATH-like vars#2733

Open
SergioChan wants to merge 1 commit intogo-task:mainfrom
SergioChan:fix-joinenv-2406
Open

templater: add joinEnv helper for PATH-like vars#2733
SergioChan wants to merge 1 commit intogo-task:mainfrom
SergioChan:fix-joinenv-2406

Conversation

@SergioChan
Copy link

Summary

  • add a new joinEnv template helper that joins path-like values with the OS-specific path list separator (: on POSIX, ; on Windows)
  • expose joinEnv in the templater function map so Taskfiles can build cross-platform PATH values cleanly
  • add unit coverage for both direct helper behavior and template function registration

Testing

  • git diff --check
  • go test ./internal/templater (not runnable in this environment: required Go toolchain go1.25 is unavailable via GOTOOLCHAIN download)

Related

Fixes #2406

return shell.Fields(s, nil)
}

func joinEnv(elems ...string) string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to call this function pathJoinList.

@trulede
Copy link
Contributor

trulede commented Mar 14, 2026

A more succinct solution to duplicate #2408

@trulede trulede added the area: templating Changes related to the templating engine. label Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: templating Changes related to the templating engine.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants