Skip to content

Commit 8901d3a

Browse files
committed
#135 trailing slash bug
1 parent 669964f commit 8901d3a

2 files changed

Lines changed: 44 additions & 1 deletion

File tree

src/cloudscribe.Web.Navigation/TreeNodeExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public static TreeNode<NavigationNode> FindByUrlExact(
3232

3333
if (!string.IsNullOrEmpty(n.Value.Url))
3434
{
35-
if (n.Value.Url.Equals(urlToMatch, StringComparison.OrdinalIgnoreCase))
35+
if (n.Value.Url.Equals(urlToMatch.TrimEnd('/'), StringComparison.OrdinalIgnoreCase))
3636
{ return true; }
3737
}
3838

update_version.ps1

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
###################
2+
## PS script to implement a semantic versioning change from (say) 8.0.x to 8.1
3+
## across all interdependent cs packages
4+
5+
## Wherever we have <Version>8.0.n</Version> replace it to <Version>8.1.0</Version> where n >= 0
6+
7+
## Wherever we have <PackageReference Include="cloudscribe.Anything" Version="8.0.*" /> replace it to <PackageReference Include="cloudscribe.Anything" Version="8.1.*" />
8+
9+
## Wherever we have <PackageReference Include="cloudscribe.Anything" Version="8.0.n" /> replace it to <PackageReference Include="cloudscribe.Anything" Version="8.1.0" /> where n >= 0
10+
11+
## Exclude cloudscribe.HtmlAgilityPack and DbHelpers because those ones are ancient and frozen
12+
###################
13+
14+
15+
# Define the directory containing the .csproj files
16+
$directory = "src"
17+
18+
# Define the new version
19+
$newVersion = "8.1.0"
20+
$newWildcardVersion = "8.1.*"
21+
22+
# Get all .csproj files in the directory and subdirectories
23+
$csprojFiles = Get-ChildItem -Path $directory -Recurse -Filter *.csproj
24+
25+
foreach ($file in $csprojFiles) {
26+
# Read the content of the .csproj file
27+
$content = Get-Content -Path $file.FullName
28+
29+
# Update the version of cloudscribe package references, except for cloudscribe.HtmlAgilityPack and cloudscribe.DbHelpers
30+
$updatedContent = $content -replace '(?<=<PackageReference Include="cloudscribe\.(?!HtmlAgilityPack|DbHelpers)[^"]+" Version=")8\.0\.\*', $newWildcardVersion
31+
$updatedContent = $updatedContent -replace '(?<=<PackageReference Include="cloudscribe\.(?!HtmlAgilityPack|DbHelpers)[^"]+" Version=")8\.0\.\d+', $newVersion
32+
33+
# Update the <Version> element if it matches the 8.0.* pattern
34+
$updatedContent = $updatedContent -replace '<Version>8\.0\.\d+</Version>', "<Version>$newVersion</Version>"
35+
36+
# Write the updated content back to the .csproj file
37+
Set-Content -Path $file.FullName -Value $updatedContent
38+
39+
Write-Host "Updated $file.FullName"
40+
}
41+
42+
Write-Host "All cloudscribe package references (except cloudscribe.HtmlAgilityPack and cloudscribe.DbHelpers) and <Version> elements have been updated to version $newVersion or $newWildcardVersion as appropriate."
43+

0 commit comments

Comments
 (0)