BililiveRecorder/CI/patch_buildinfo.ps1

8 lines
492 B
PowerShell
Raw Permalink Normal View History

2018-04-14 07:05:25 +08:00
# called by msbuild
2018-03-29 10:36:13 +08:00
$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