From f9939cf74ca5f032fcb44ab37f01a3edcfeec529 Mon Sep 17 00:00:00 2001 From: Pairi Daiza Date: Thu, 18 Jun 2020 18:29:23 +0200 Subject: [PATCH] + fix: hardening commit_id.txt file (bis) --- Version.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Version.ps1 b/Version.ps1 index cb3e455bc..d39ecdb69 100644 --- a/Version.ps1 +++ b/Version.ps1 @@ -64,14 +64,14 @@ try $CommitID = ([string]($env:computername)).substring(0,[math]::min($length,8)).ToLower() } else { + if (!$CommitID) { $CommitID = "---" } + $CommitID = $CommitID -replace '"', '' + $CommitID = $CommitID -replace "'", '' $length = $CommitID.length $CommitID = $CommitID.substring(0,[math]::min($length,8)) } } if (!$CommitID) { $CommitID = "---" } - $CommitID = $CommitID -replace '"', '' - $CommitID = $CommitID -replace "'", '' - if (!$CommitID) { $CommitID = "---" } $Build | Set-Content "Versions\build.txt" $CompleteVer = "$Major.$Minor.$Revis.$Build"