From 16a8a824412a2d16429e65f02d3e65e21c5445f4 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Fri, 31 May 2024 09:01:30 +0200 Subject: [PATCH] Added check for whitespace in file that contains the native version. --- src/Magick.Native/install.ps1 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Magick.Native/install.ps1 b/src/Magick.Native/install.ps1 index a1812f5e82..0166f11b76 100644 --- a/src/Magick.Native/install.ps1 +++ b/src/Magick.Native/install.ps1 @@ -161,7 +161,12 @@ function createTrademarkAttribute($source, $target) { [assembly: System.Reflection.AssemblyTrademark(""ImageMagick $imageMagickVersion"")]")) } -$version = [IO.File]::ReadAllText("$PSScriptRoot\Magick.Native.version").Trim() +$version = [IO.File]::ReadAllText("$PSScriptRoot\Magick.Native.version") +if ($version -ne $version.Trim()) { + Write-Error "Version contains whitespace" + Exit 1 +} + $folder = "$PSScriptRoot\temp" $libraries = "$PSScriptRoot\libraries" $windowsLibraries = "$libraries\win"