Skip to content

Fix path handling in build.ps1. #252

Open
@jeffdav

Description

@jeffdav

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions