mirror of
https://github.com/actions/versions-package-tools.git
synced 2025-12-10 03:13:23 +00:00
Move helpers to the separate repository
This commit is contained in:
34
packages-generation/nix-helpers.psm1
Normal file
34
packages-generation/nix-helpers.psm1
Normal file
@@ -0,0 +1,34 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Pack folder to *.zip format
|
||||
#>
|
||||
function Pack-Zip {
|
||||
param(
|
||||
[Parameter(Mandatory=$true)]
|
||||
[String]$PathToArchive,
|
||||
[Parameter(Mandatory=$true)]
|
||||
[String]$ToolZipFile
|
||||
)
|
||||
|
||||
Write-Debug "Pack $PathToArchive to $ToolZipFile"
|
||||
Push-Location -Path $PathToArchive
|
||||
zip -q -r $ToolZipFile * | Out-Null
|
||||
Pop-Location
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Unpack *.tar file
|
||||
#>
|
||||
function Unpack-TarArchive {
|
||||
param(
|
||||
[Parameter(Mandatory=$true)]
|
||||
[String]$ArchivePath,
|
||||
[Parameter(Mandatory=$true)]
|
||||
[String]$OutputDirectory
|
||||
)
|
||||
|
||||
Write-Debug "Unpack $ArchivePath to $OutputDirectory"
|
||||
tar -C $OutputDirectory -xzf $ArchivePath
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user