mirror of
https://github.com/actions/node-versions.git
synced 2025-01-11 02:25:19 +00:00
9f83a0c6de
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
34 lines
947 B
PowerShell
34 lines
947 B
PowerShell
<#
|
|
.SYNOPSIS
|
|
Unpack *.7z file
|
|
#>
|
|
function Extract-SevenZipArchive {
|
|
param(
|
|
[Parameter(Mandatory=$true)]
|
|
[String]$ArchivePath,
|
|
[Parameter(Mandatory=$true)]
|
|
[String]$OutputDirectory
|
|
)
|
|
|
|
Write-Debug "Extract $ArchivePath to $OutputDirectory"
|
|
7z x $ArchivePath -o"$OutputDirectory" -y | Out-Null
|
|
}
|
|
|
|
function Create-SevenZipArchive {
|
|
param(
|
|
[Parameter(Mandatory=$true)]
|
|
[String]$SourceFolder,
|
|
[Parameter(Mandatory=$true)]
|
|
[String]$ArchivePath,
|
|
[String]$ArchiveType = "zip",
|
|
[String]$CompressionLevel = 5
|
|
)
|
|
|
|
$ArchiveTypeArgument = "-t${ArchiveType}"
|
|
$CompressionLevelArgument = "-mx=${CompressionLevel}"
|
|
|
|
Push-Location $SourceFolder
|
|
Write-Debug "7z a $ArchiveTypeArgument $CompressionLevelArgument $ArchivePath @$SourceFolder"
|
|
7z a $ArchiveTypeArgument $CompressionLevelArgument $ArchivePath $SourceFolder\*
|
|
Pop-Location
|
|
} |