forked from moonlight-stream/moonlight-qt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-deps.ps1
More file actions
31 lines (25 loc) · 1.01 KB
/
Copy pathsetup-deps.ps1
File metadata and controls
31 lines (25 loc) · 1.01 KB
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
$ErrorActionPreference = 'Stop'
$Organization = "moonlight-stream"
$PrebuiltRepo = "moonlight-qt-deps"
$TargetDir = Join-Path $PSScriptRoot "libs\windows"
$Assets = @("windows-x64.zip", "windows-ARM64.zip")
$Tag = "v12"
if (Test-Path $TargetDir) {
Write-Host "Cleaning target directory..." -ForegroundColor Cyan
Remove-Item -Path "$TargetDir\*" -Recurse -Force
} else {
New-Item -ItemType Directory -Path $TargetDir | Out-Null
}
foreach ($AssetName in $Assets) {
$Url = "https://github.com/$Organization/$PrebuiltRepo/releases/download/$Tag/$AssetName"
$ArchivePath = Join-Path $env:TEMP $AssetName
Write-Host "Downloading $AssetName..." -ForegroundColor Cyan
curl.exe -s -L -f -o "$ArchivePath" "$Url"
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
Write-Host "Extracting $AssetName..." -ForegroundColor Cyan
Expand-Archive -Path $ArchivePath -DestinationPath $TargetDir -Force
Remove-Item $ArchivePath
}
Write-Host "Dependencies successfully deployed" -ForegroundColor Green