File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -260,17 +260,6 @@ local function shellQuote(value)
260260 return " '" .. string.gsub (value , " '" , " '\\ ''" ) .. " '"
261261end
262262
263- local function powershellSingleQuotedLiteral (value )
264- if string.find (value , " [\r\n %z]" ) then
265- error (" Path contains unsupported control character: " .. value )
266- end
267- if containsTraversalSegment (value ) then
268- error (" Path contains unsupported traversal segment: " .. value )
269- end
270-
271- return " '" .. string.gsub (value , " '" , " ''" ) .. " '"
272- end
273-
274263local function startsWith (value , prefix )
275264 return string.sub (value , 1 , string.len (prefix )) == prefix
276265end
@@ -484,7 +473,8 @@ local function verifyUvBuildArchive(path, sha256)
484473 local status
485474 if RUNTIME .osType == " windows" or OS_TYPE == " windows" then
486475 local command = " powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command " ..
487- shellQuote (" (Get-FileHash -LiteralPath " .. powershellSingleQuotedLiteral (path ) .. " -Algorithm SHA256).Hash" )
476+ shellQuote (" & { param([string]$p) (Get-FileHash -LiteralPath $p -Algorithm SHA256).Hash }" ) ..
477+ " " .. shellQuote (path )
488478 local handle = io.popen (command )
489479 if handle == nil then
490480 error (" Unable to verify uv-build archive sha256 for " .. path .. " : powershell Get-FileHash command could not be started" )
You can’t perform that action at this time.
0 commit comments