fix(perception): support worker powershell runtime
This commit is contained in:
@@ -114,10 +114,17 @@ function Write-Utf8NoBom([string]$Path, [string]$Value) {
|
||||
}
|
||||
|
||||
function Get-DirectoryTreeSha256([string]$Root, [object[]]$Files) {
|
||||
$rootPrefix = $Root.TrimEnd("\") + "\"
|
||||
$rows = @(
|
||||
foreach ($file in $Files) {
|
||||
if (-not $file.FullName.StartsWith(
|
||||
$rootPrefix,
|
||||
[StringComparison]::OrdinalIgnoreCase
|
||||
)) {
|
||||
throw "M4 dependency file escaped its declared root"
|
||||
}
|
||||
[pscustomobject]@{
|
||||
Relative = [IO.Path]::GetRelativePath($Root, $file.FullName).Replace("\", "/")
|
||||
Relative = $file.FullName.Substring($rootPrefix.Length).Replace("\", "/")
|
||||
File = $file
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user