ensure rev sync

This commit is contained in:
InkerBot
2026-03-05 15:48:21 +08:00
parent 629b8c3066
commit daba0d704e
5 changed files with 74 additions and 6 deletions
+6 -1
View File
@@ -3,6 +3,7 @@ $ErrorActionPreference = 'Stop'
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
$Root = Split-Path -Parent $ScriptDir
$SingBox = Join-Path $Root 'works/sing-box'
$RevFile = Join-Path $Root 'works/rev'
# defaults
$RepoUrl = 'git@git.inker.bot:arknights/sing-box.git'
@@ -34,6 +35,10 @@ if (Test-Path (Join-Path $SingBox '.git')) {
}
}
$Rev = git -C $SingBox rev-parse HEAD
Set-Content -Path $RevFile -Value $Rev -NoNewline
$version = git -C $SingBox describe --tags --always 2>$null
if (-not $version) { $version = git -C $SingBox rev-parse --short HEAD }
if (-not $version) { $version = $Rev.Substring(0, 7) }
Write-Host "Done. Version: $version"
Write-Host "Stored rev: $Rev"