Bladeren bron

Cleanup: don't actually need the '//end' marker.

Martijn Laan 3 maanden geleden
bovenliggende
commit
edd7d1aa0e
2 gewijzigde bestanden met toevoegingen van 3 en 3 verwijderingen
  1. 2 2
      Components/TrustFunc.AllowedPublicKeys.inc
  2. 1 1
      issig.bat

+ 2 - 2
Components/TrustFunc.AllowedPublicKeys.inc

@@ -4,7 +4,7 @@
   functionality.
   
   Other builds: if you need only one key you can set AllowedPublicKey2Text To
-  an empty string and remove the '//end' marker. }
+  an empty string. }
 
 AllowedPublicKey1Text :=
 'format issig-public-key' + #13#10 +
@@ -16,4 +16,4 @@ AllowedPublicKey2Text :=
 'format issig-public-key' + #13#10 +
 'key-id def020edee3c4835fd54d85eff8b66d4d899b22a777353ca4a114b652e5e7a28' + #13#10 +
 'public-x 515dc7d6c16d4a46272ceb3d158c5630a96466ab4d948e72c2029d737c823097' + #13#10 +
-'public-y f3c21f6b5156c52a35f6f28016ee3e31a3ded60c325b81fb7b1f88c221081a61' + #13#10;//end
+'public-y f3c21f6b5156c52a35f6f28016ee3e31a3ded60c325b81fb7b1f88c221081a61' + #13#10;

+ 1 - 1
issig.bat

@@ -49,7 +49,7 @@ set publickeyfile=_temp.ispublickey
 ISSigTool.exe export-public-key "%publickeyfile%"
 if errorlevel 1 goto failed
 if not exist "%publickeyfile%" goto failed
-powershell.exe -NoProfile -Command "$filePath = '%targetfile%'; $replacementFilePath = '%publickeyfile%'; $startMarker = 'AllowedPublicKey2Text :='; $endMarker = ';//end'; try { $content = Get-Content -Raw -Path $filePath; $replacementText = Get-Content -Raw -Path $replacementFilePath; $replacementText = $replacementText -replace \"`r`n\", \"' + #13#10 +`r`n'\"; $replacementText = \"'\" + $replacementText + \"'\"; $replacementText = $replacementText -replace \" \+`r`n''\", \"\"; [string] $pattern = '(?s)' + [regex]::Escape($startMarker) + '.*?' + [regex]::Escape($endMarker); if ($content -match $pattern) { $replacement = $startMarker + \"`r`n\" + $replacementText  + $endMarker; $newContent = $content -replace $pattern, $replacement; $utf8NoBomEncoding = New-Object System.Text.UTF8Encoding($false); [System.IO.File]::WriteAllText($filePath, $newContent, $utf8NoBomEncoding); Write-Host 'Embedded key.'; } else { Write-Host 'Markers not found.'; exit 1; } } catch { Write-Error ('Error: ' + $_.Exception.Message); exit 1; }"
+powershell.exe -NoProfile -Command "$filePath = '%targetfile%'; $replacementFilePath = '%publickeyfile%'; $startMarker = 'AllowedPublicKey2Text :='; $endMarker = ';'; try { $content = Get-Content -Raw -Path $filePath; $replacementText = Get-Content -Raw -Path $replacementFilePath; $replacementText = $replacementText -replace \"`r`n\", \"' + #13#10 +`r`n'\"; $replacementText = \"'\" + $replacementText + \"'\"; $replacementText = $replacementText -replace \" \+`r`n''\", \"\"; [string] $pattern = '(?s)' + [regex]::Escape($startMarker) + '.*?' + [regex]::Escape($endMarker); if ($content -match $pattern) { $replacement = $startMarker + \"`r`n\" + $replacementText  + $endMarker; $newContent = $content -replace $pattern, $replacement; $utf8NoBomEncoding = New-Object System.Text.UTF8Encoding($false); [System.IO.File]::WriteAllText($filePath, $newContent, $utf8NoBomEncoding); Write-Host 'Embedded key.'; } else { Write-Host 'Markers not found.'; exit 1; } } catch { Write-Error ('Error: ' + $_.Exception.Message); exit 1; }"
 if errorlevel 1 goto failed
 del "%publickeyfile%"
 if errorlevel 1 goto failed