From d7b60faf65386668b1b4d513291ea43dda452768 Mon Sep 17 00:00:00 2001 From: Leonmmcoset Date: Mon, 9 Feb 2026 02:47:24 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BE=93=E5=87=BAgit=E5=93=88=E5=B8=8C?= =?UTF-8?q?=E5=80=BC2=20=E4=BF=AE=E5=A4=8D=E9=97=AE=E5=8F=B7bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GenerateGitCommit.ps1 | 5 +++-- GitCommit.txt | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/GenerateGitCommit.ps1 b/GenerateGitCommit.ps1 index 8201552..93de2bf 100644 --- a/GenerateGitCommit.ps1 +++ b/GenerateGitCommit.ps1 @@ -8,9 +8,10 @@ try { if ($LASTEXITCODE -eq 0) { $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 "Full Hash: $commitHash.Trim()" -ForegroundColor Cyan + Write-Host "Full Hash: $trimmedHash" -ForegroundColor Cyan } else { Write-Host "Warning: Not a git repository or git not found" -ForegroundColor Yellow diff --git a/GitCommit.txt b/GitCommit.txt index 90ea7dc..48a9dcc 100644 --- a/GitCommit.txt +++ b/GitCommit.txt @@ -1 +1 @@ -9ac476e \ No newline at end of file +a01dd4e \ No newline at end of file