mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-20 12:40:05 +00:00
24 lines
961 B
PowerShell
24 lines
961 B
PowerShell
$ErrorActionPreference = "Stop"
|
|
$scriptPath = $MyInvocation.MyCommand.Path
|
|
$scriptDir = Split-Path $scriptPath
|
|
cd $scriptDir
|
|
rm UltraGrid-nightly*
|
|
Invoke-WebRequest https://github.com/CESNET/UltraGrid/releases/download/nightly/UltraGrid-nightly-win64.zip -OutFile UltraGrid-nightly-win64.zip
|
|
if ($LastExitCode -ne 0) {
|
|
throw "Download failed"
|
|
}
|
|
$downloadExtractDir = "UltraGrid-nightly-latest-win64"
|
|
Expand-Archive -LiteralPath UltraGrid-nightly-win64.zip -DestinationPath $downloadExtractDir
|
|
$currentName = (Split-Path -Leaf Get-Location).Path
|
|
$downloadedName = (Get-ChildItem $downloadExtractDir).Name
|
|
if ($currentName -ne $downloadedName) {
|
|
Move-Item $downloadExtractDir/* ..
|
|
Write-Host "Downloaded ,$downloadedName removing $currentName."
|
|
Set-Location ../$downloadedName
|
|
Remove-Item -Recurse ../$currentName
|
|
} else {
|
|
Remove-Item -Recurse $downloadExtractDir
|
|
Remove-Item UltraGrid-nightly-win64.zip
|
|
}
|
|
|