-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathunpack.ps1
More file actions
32 lines (31 loc) · 965 Bytes
/
unpack.ps1
File metadata and controls
32 lines (31 loc) · 965 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
30
31
32
$oldLocation = Get-Location
try {
Set-Location -Path 'C:\'
$files = Get-ChildItem -Path 'C:\pack' -Filter '*-artifacts.tar.zst'
if ($files.Count -gt 0) {
$start = Get-Date
Write-Host "Unpack started at $start"
foreach ($z in $files) {
$zst = $z.FullName
$tar = [IO.Path]::ChangeExtension($zst, '.tar')
if (-not (Test-Path $tar)) {
& zstd -d -T0 $zst -o $tar
}
tar -xf $tar
Remove-Item $tar, $zst -ErrorAction SilentlyContinue
}
dir
$end = Get-Date
Write-Host "Unpack finished at $end"
$duration = $end - $start
Write-Host "Total duration: $($duration.ToString())"
git config --global --add safe.directory '*'
Write-Host "All directories marked safe for Git."
}
else {
Write-Host "No artifacts to unpack."
}
}
finally {
Set-Location -Path $oldLocation
}