Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix path handling in build.ps1. #252

Open
jeffdav opened this issue Feb 12, 2025 · 0 comments
Open

Fix path handling in build.ps1. #252

jeffdav opened this issue Feb 12, 2025 · 0 comments

Comments

@jeffdav
Copy link

jeffdav commented Feb 12, 2025

Some places use Join-Path, some use [IO.Path]::Combine(), and others just use string interpolation ($Path = "foo/$bar/baz" style). All three of these behave differently.

Currently CI passes in values assuming that we will concatenate a \ before appending more, but this is an unspoken convention and is not enforced. If we use [IO.Path]::Combine() and a bare drive letter is passed in (e.g. s:) this assumption breaks.

We should use Join-Path or Combine() everywhere, disallow bare drives as paths via [ValidatePattern('^(?!^[a-zA-Z]:$|^[a-zA-Z]:[^\\].*$).*$')] on the incoming params, and update the calling batch files to pass t:\ if they want stuff in the root.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant