Switch packages for Ubuntu & macOS to use tar.gz format instead of zip (#6)

Switch to using tar.gz format for Ubuntu and macOS systems because it is much more common on nix systems which is important in container scenarios
This commit is contained in:
Maxim Lobanov
2020-04-23 18:42:48 +03:00
committed by GitHub
parent e510e2cfd6
commit 9f83a0c6de
7 changed files with 65 additions and 22 deletions

View File

@@ -12,5 +12,21 @@ function Extract-TarArchive {
Write-Debug "Extract $ArchivePath to $OutputDirectory"
tar -C $OutputDirectory -xzf $ArchivePath --strip 1
}
function Create-TarArchive {
param(
[Parameter(Mandatory=$true)]
[String]$SourceFolder,
[Parameter(Mandatory=$true)]
[String]$ArchivePath,
[string]$CompressionType = "gz"
)
$CompressionTypeArgument = If ([string]::IsNullOrWhiteSpace($CompressionType)) { "" } else { "--${CompressionType}" }
Push-Location $SourceFolder
Write-Debug "tar -c $CompressionTypeArgument -f $ArchivePath ."
tar -c $CompressionTypeArgument -f $ArchivePath .
Pop-Location
}