-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathnix-zip.ps1
More file actions
29 lines (26 loc) · 817 Bytes
/
nix-zip.ps1
File metadata and controls
29 lines (26 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Param (
[Parameter(Mandatory=$true)][string]$Version,
[Parameter(Mandatory=$true)][string]$Directory,
[Parameter(Mandatory=$true)][string]$Platform
)
$ErrorActionPreference = 'Stop'
Push-Location -Path "src\Xecrets.Cli\bin\Release\net10.0\publish\$Directory"
try {
$cmd = @(
"exec {BASH_XTRACEFD}>&1"
"set -euox pipefail"
"chmod 775 XecretsCli"
"mkdir 'XecretsCli-$Platform-$Version'"
"cp -r XecretsCli 'XecretsCli-$Platform-$Version'"
"tar -czvf 'XecretsCli-$Platform-$Version.tar.gz' 'XecretsCli-$Platform-$Version'"
"rm -rf 'XecretsCli-$Platform-$Version'"
) -join " && "
wsl bash -lc "$cmd"
if ($LASTEXITCODE -ne 0) {
throw "WSL command failed with exit code $LASTEXITCODE"
}
}
finally
{
Pop-Location
}