ensure rev sync
This commit is contained in:
+6
-1
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user