mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-05-28 17:16:29 +03:00
17 lines
486 B
PowerShell
17 lines
486 B
PowerShell
Set-Location (Resolve-Path "$PSScriptRoot\..\..")
|
|
|
|
$COMMIT_NUMBER = git rev-list "$((git tag --sort=-creatordate | Select-String ecode | Select-Object -First 1).Line)..HEAD" --count
|
|
|
|
if ($LASTEXITCODE) {
|
|
Write-Error "Error: git binary not found"
|
|
exit $LASTEXITCODE
|
|
}
|
|
|
|
$FILE_PATH = ".\src\tools\ecode\version.hpp"
|
|
|
|
try {
|
|
(Get-Content $FILE_PATH) -replace '#define ECODE_COMMIT_NUMBER \d+', "#define ECODE_COMMIT_NUMBER $COMMIT_NUMBER" | Set-Content $FILE_PATH
|
|
} catch {
|
|
exit 1
|
|
}
|