diff --git a/Minecraft.Client/postbuild.ps1 b/Minecraft.Client/postbuild.ps1 index 8ffc9b98b..6d2bda12b 100644 --- a/Minecraft.Client/postbuild.ps1 +++ b/Minecraft.Client/postbuild.ps1 @@ -36,8 +36,6 @@ foreach ($copy in $copies) { if (Test-Path $src) { # Copy the files using xcopy, forcing overwrite and suppressing errors, and only copying if the source is newer than the destination - xcopy /q /y /i /s /e /d "$src" "$dst" 2>$null + xcopy /q /y /i /s /e /d "$src" "$dst" 2>$null } -} - -git restore "**/BuildVer.h" \ No newline at end of file +} \ No newline at end of file diff --git a/Minecraft.Client/prebuild.ps1 b/Minecraft.Client/prebuild.ps1 index 0acbf023b..99078e9e5 100644 --- a/Minecraft.Client/prebuild.ps1 +++ b/Minecraft.Client/prebuild.ps1 @@ -27,7 +27,7 @@ if (git status --porcelain) { $suffix = "-dev" } -@" +$newContent = @" #pragma once #define VER_PRODUCTBUILD $build @@ -35,4 +35,14 @@ if (git status --porcelain) { #define VER_FILEVERSION_STR_W VER_PRODUCTVERSION_STR_W #define VER_BRANCHVERSION_STR_W L"$ref" #define VER_NETWORK VER_PRODUCTBUILD -"@ | Set-Content "Common/BuildVer.h" +"@ + +$path = "Common/BuildVer.h" +$existing = if (Test-Path $path) { Get-Content $path -Raw } else { "" } + +if ($existing.Trim() -ne $newContent.Trim()) { + $newContent | Set-Content $path + Write-Host "BuildVer.h aggiornato." +} else { + Write-Host "BuildVer.h invariato, skip." +} \ No newline at end of file