Skip to content

Commit c14868d

Browse files
committed
Use only tar to create tar.gz archive
1 parent 37b004e commit c14868d

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

build.ps1

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -716,20 +716,21 @@ if ($packageType -eq 'msixbundle') {
716716
$architecture
717717
}
718718

719-
$packageName = "DSC-$productVersion-$productArchitecture.tar"
719+
Write-Verbose -Verbose "Creating tar.gz file"
720+
$packageName = "DSC-$productVersion-$productArchitecture.tar.gz"
720721
$tarFile = Join-Path $PSScriptRoot 'bin' $packageName
721-
tar cvf $tarFile -C $tgzTarget .
722+
tar -czvf $tarFile -C $tgzTarget .
722723
if ($LASTEXITCODE -ne 0) {
723-
throw "Failed to create tar file"
724+
throw "Failed to create tar.gz file"
724725
}
725-
Write-Host -ForegroundColor Green "`nTar file is created at $tarFile"
726726

727-
$gzFile = "$tarFile.gz"
728-
gzip -c $tarFile > $gzFile
729-
if ($LASTEXITCODE -ne 0) {
730-
throw "Failed to create gz file"
727+
# check it's valid
728+
$out = file $tarFile
729+
if ($out -notmatch 'gzip compressed data') {
730+
throw "Invalid tar.gz file"
731731
}
732-
Write-Host -ForegroundColor Green "`nGz file is created at $gzFile"
732+
733+
Write-Host -ForegroundColor Green "`ntar.gz file is created at $tarFile"
733734
}
734735

735736
$env:RUST_BACKTRACE=1

0 commit comments

Comments
 (0)