mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-11 21:03:05 +08:00
+ fix: hardening commit_id.txt file input for version string assembling
This commit is contained in:
parent
e8fe78e241
commit
c2efb99ab1
@ -58,6 +58,7 @@ try
|
||||
$Build = $Build + 1
|
||||
# locally: we have no commit ID, create an arificial one
|
||||
$CommitID = [string](Get-Content "Versions\commit_id.txt")
|
||||
if (!$CommitID) { $CommitID = "---" }
|
||||
if ($CommitID -eq "computername") {
|
||||
$length = ([string]($env:computername)).length
|
||||
$CommitID = ([string]($env:computername)).substring(0,[math]::min($length,8)).ToLower()
|
||||
@ -68,6 +69,9 @@ try
|
||||
}
|
||||
}
|
||||
if (!$CommitID) { $CommitID = "---" }
|
||||
$CommitID = $CommitID -replace '"', ''
|
||||
$CommitID = $CommitID -replace "'", ''
|
||||
if (!$CommitID) { $CommitID = "---" }
|
||||
$Build | Set-Content "Versions\build.txt"
|
||||
|
||||
$CompleteVer = "$Major.$Minor.$Revis.$Build"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user