Skip to content

Commit e65f0ea

Browse files
authored
Merge pull request #747 from betalgo/feat-nuget-regex-options-e742c
Enhance publish-nuget.ps1 script by adding VersionRegexOptions parame…
2 parents 2730fde + 18cade1 commit e65f0ea

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/scripts/publish-nuget.ps1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ param(
3030

3131
[string]$GitHubPackagesSource,
3232

33-
[bool]$GitHubPackagesIncludeSymbols = $false
33+
[bool]$GitHubPackagesIncludeSymbols = $false,
34+
35+
[System.Text.RegularExpressions.RegexOptions]$VersionRegexOptions = [System.Text.RegularExpressions.RegexOptions]::Multiline
3436
)
3537

3638
$ErrorActionPreference = 'Stop'
@@ -93,7 +95,7 @@ if (-not $VersionStatic) {
9395
}
9496

9597
$fileContent = Get-Content $versionFilePath -Raw
96-
$match = [regex]::Match($fileContent, $VersionRegex)
98+
$match = [regex]::Match($fileContent, $VersionRegex, $VersionRegexOptions)
9799
if (-not $match.Success -or -not $match.Groups[1].Value) {
98100
throw "Unable to extract version information using regex '$VersionRegex' from '$versionFilePath'."
99101
}

0 commit comments

Comments
 (0)