mirror of
https://github.com/wwiinnddyy/LanMountainDesktop.git
synced 2026-06-20 23:54:26 +08:00
feat.尝试弄了AOT的启动器。
This commit is contained in:
28
scripts/Generate-VersionFile.ps1
Normal file
28
scripts/Generate-VersionFile.ps1
Normal file
@@ -0,0 +1,28 @@
|
||||
# 生成版本信息文件
|
||||
param(
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]$OutputPath,
|
||||
|
||||
[Parameter(Mandatory=$true)]
|
||||
[string]$Version,
|
||||
|
||||
[Parameter(Mandatory=$false)]
|
||||
[string]$Codename = "Administrate"
|
||||
)
|
||||
|
||||
$versionInfo = @{
|
||||
Version = $Version
|
||||
Codename = $Codename
|
||||
}
|
||||
|
||||
$json = $versionInfo | ConvertTo-Json -Compress
|
||||
$dir = Split-Path -Parent $OutputPath
|
||||
|
||||
if (!(Test-Path $dir)) {
|
||||
New-Item -ItemType Directory -Path $dir -Force | Out-Null
|
||||
}
|
||||
|
||||
Set-Content -Path $OutputPath -Value $json -Encoding UTF8
|
||||
Write-Host "Generated version file: $OutputPath" -ForegroundColor Green
|
||||
Write-Host " Version: $Version" -ForegroundColor Gray
|
||||
Write-Host " Codename: $Codename" -ForegroundColor Gray
|
||||
Reference in New Issue
Block a user