输出git哈希值2

修复问号bug
This commit is contained in:
2026-02-09 02:47:24 +08:00
parent a01dd4e10c
commit d7b60faf65
2 changed files with 4 additions and 3 deletions

View File

@@ -8,9 +8,10 @@ try {
if ($LASTEXITCODE -eq 0) { if ($LASTEXITCODE -eq 0) {
$shortHash = $commitHash.Substring(0, 7).Trim() $shortHash = $commitHash.Substring(0, 7).Trim()
$shortHash | Out-File -FilePath $commitFile -Encoding UTF8 -NoNewline $trimmedHash = $commitHash.Trim()
[System.IO.File]::WriteAllText($commitFile, $shortHash, [System.Text.Encoding]::ASCII)
Write-Host "Git Commit Hash: $shortHash" -ForegroundColor Green Write-Host "Git Commit Hash: $shortHash" -ForegroundColor Green
Write-Host "Full Hash: $commitHash.Trim()" -ForegroundColor Cyan Write-Host "Full Hash: $trimmedHash" -ForegroundColor Cyan
} }
else { else {
Write-Host "Warning: Not a git repository or git not found" -ForegroundColor Yellow Write-Host "Warning: Not a git repository or git not found" -ForegroundColor Yellow

View File

@@ -1 +1 @@
9ac476e a01dd4e