@@ -37,6 +37,33 @@ if (-not $SkipFrontend) {
|
||||
|
||||
New-Item -ItemType Directory -Force -Path $Out | Out-Null
|
||||
|
||||
function Copy-IfExists {
|
||||
param(
|
||||
[string]$Source,
|
||||
[string]$Destination
|
||||
)
|
||||
if (Test-Path $Source) {
|
||||
if (Test-Path $Destination) {
|
||||
Remove-Item -Recurse -Force $Destination
|
||||
}
|
||||
New-Item -ItemType Directory -Force -Path (Split-Path $Destination -Parent) | Out-Null
|
||||
Copy-Item -Recurse -Force $Source $Destination
|
||||
}
|
||||
}
|
||||
|
||||
$RepoRoot = Resolve-Path (Join-Path $Root "..\..")
|
||||
$DataUpdatePublic = Join-Path $Out "data\update\public"
|
||||
$DataUpdateNotice = Join-Path $Out "data\update-notice"
|
||||
New-Item -ItemType Directory -Force -Path $DataUpdatePublic | Out-Null
|
||||
Copy-IfExists (Join-Path $RepoRoot "update-notice") $DataUpdateNotice
|
||||
foreach ($Name in @("update-info.json", "media-types.json", "tool-status.json", "modules.json")) {
|
||||
$Source = Join-Path $RepoRoot "server\update\public\$Name"
|
||||
if (Test-Path $Source) {
|
||||
Copy-Item -Force $Source (Join-Path $DataUpdatePublic $Name)
|
||||
}
|
||||
}
|
||||
Copy-IfExists (Join-Path $RepoRoot "server\update\public\downloads") (Join-Path $DataUpdatePublic "downloads")
|
||||
|
||||
$Targets = @(
|
||||
@{ GOOS = "windows"; GOARCH = "amd64"; Name = "ymhut-unified-management-windows-amd64.exe" },
|
||||
@{ GOOS = "linux"; GOARCH = "amd64"; Name = "ymhut-unified-management-linux-amd64" },
|
||||
|
||||
Reference in New Issue
Block a user