windows构建脚本编码格式转换

This commit is contained in:
2026-01-27 09:42:08 +08:00
parent 15cceac7e0
commit 0fe45e3847
2 changed files with 12 additions and 12 deletions

View File

@@ -1,7 +1,7 @@
$AppName = "BingPaper"
$OutputDir = "output"
Write-Host "开始构建 $AppName 多平台二进制文件..."
Write-Host "开始构建 $AppName 多平台二进制文件..."
if (Test-Path $OutputDir) {
Remove-Item -Recurse -Force $OutputDir
@@ -28,7 +28,7 @@ foreach ($Platform in $Platforms) {
$BinaryName = "$OutputName.exe"
}
Write-Host "正在编译 $OS/$Arch..."
Write-Host "正在编译 $OS/$Arch..."
$PackageDir = Join-Path $OutputDir $OutputName
if (-not (Test-Path $PackageDir)) {
@@ -41,7 +41,7 @@ foreach ($Platform in $Platforms) {
go build -o (Join-Path $PackageDir $BinaryName) main.go
if ($LASTEXITCODE -eq 0) {
Write-Host " $OS/$Arch 编译成功"
Write-Host " $OS/$Arch 编译成功"
Copy-Item -Recurse "web" $PackageDir\
Copy-Item "config.example.yaml" $PackageDir\
@@ -53,9 +53,9 @@ foreach ($Platform in $Platforms) {
Remove-Item -Recurse -Force $OutputName
Set-Location $CurrentDir
Write-Host " $OS/$Arch 打包完成: ${OutputName}.tar.gz"
Write-Host " $OS/$Arch 打包完成: ${OutputName}.tar.gz"
} else {
Write-Host " $OS/$Arch 编译失败"
Write-Host " $OS/$Arch 编译失败"
if (Test-Path $PackageDir) {
Remove-Item -Recurse -Force $PackageDir
}
@@ -63,5 +63,5 @@ foreach ($Platform in $Platforms) {
}
Write-Host "----------------------------------------"
Write-Host "多平台打包完成!输出目录: $OutputDir"
Write-Host "多平台打包完成!输出目录: $OutputDir"
Get-ChildItem -Recurse $OutputDir