fix SHA256 verification of .zip and hash contents of .zip.sha256
This commit is contained in:
parent
f30af0923d
commit
58e3ecdccc
|
@ -37,10 +37,13 @@ for %%B in (%BINARY_NAMES%) do (
|
|||
for /f "tokens=1" %%a in (!FILE_NAME!.sha256) do set "EXPECTED_SHA256=%%a"
|
||||
for /f "tokens=* usebackq" %%a in (`powershell -Command "& {Get-FileHash '!FILE_NAME!' -Algorithm SHA256 | Select-Object -ExpandProperty Hash}"`) do set "ACTUAL_SHA256=%%a"
|
||||
|
||||
if not "!ACTUAL_SHA256!"=="!EXPECTED_SHA256!" (
|
||||
echo Checksum verification failed for !FILE_NAME!. Expected: !EXPECTED_SHA256!, Got: !ACTUAL_SHA256!
|
||||
if /I not "!ACTUAL_SHA256!"=="!EXPECTED_SHA256!" (
|
||||
echo Checksum verification failed for !FILE_NAME!.
|
||||
echo Expected: !EXPECTED_SHA256!
|
||||
echo Got: !ACTUAL_SHA256!
|
||||
exit /b 1
|
||||
)
|
||||
echo Checksum verification successful for !FILE_NAME!.
|
||||
|
||||
echo Extracting !FILE_NAME!...
|
||||
powershell -Command "& {Expand-Archive -Path '!FILE_NAME!' -DestinationPath '!EXTRACT_DIR!' -Force}"
|
||||
|
@ -66,4 +69,4 @@ exit /b 0
|
|||
if not errorlevel 1 set "arch_result=arm64"
|
||||
)
|
||||
set "%1=%arch_result%"
|
||||
exit /b
|
||||
exit /b
|
Loading…
Reference in New Issue