BililiveRecorder/CI/patch_buildinfo.ps1
2018-04-14 07:05:25 +08:00

8 lines
492 B
PowerShell

# called by msbuild
$isAppveyor = if ($env:APPVEYOR -eq $null) { "false" } else { $env:APPVEYOR }
$buildversion = if ($env:p_version -eq $null) { "本地编译" } else { $env:p_version }
$githash = git rev-parse --verify HEAD
(Get-Content .\BililiveRecorder.WPF\BuildInfo.txt).Replace('[APPVEYOR]', $isAppveyor.ToLower()).Replace('[VERSION]', $buildversion).Replace('[GIT_HASH]', $githash).Replace('[GIT_HASH_S]', $githash.Substring(0, 8)) | Set-Content .\BililiveRecorder.WPF\BuildInfo.cs