From 4ab9644ffe0974ccc8272d43c67a398b1f454438 Mon Sep 17 00:00:00 2001 From: Gilbert Sanchez Date: Tue, 26 May 2026 15:38:16 -0700 Subject: [PATCH] fix: normalise AddContent path separators to forward slash on PS5.1 Get-ChildItem -Name returns backslash-separated paths on PS5.1 Windows. Manifest source/destination attributes now always use forward slashes for cross-platform consistency. Updates the test fixture accordingly (removing the $IsWindows separator branch, which was $null on PS5.1 anyway). --- Plaster/Public/New-PlasterManifest.ps1 | 8 ++++---- tests/New-PlasterManifest.Tests.ps1 | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Plaster/Public/New-PlasterManifest.ps1 b/Plaster/Public/New-PlasterManifest.ps1 index 01ab9fd..784c303 100644 --- a/Plaster/Public/New-PlasterManifest.ps1 +++ b/Plaster/Public/New-PlasterManifest.ps1 @@ -125,8 +125,8 @@ function New-PlasterManifest { $fileAction = [ordered]@{ 'type' = 'file' - 'source' = $filename - 'destination' = $filename + 'source' = $filename.Replace('\', '/') + 'destination' = $filename.Replace('\', '/') } $jsonManifest.content += $fileAction } @@ -162,11 +162,11 @@ function New-PlasterManifest { $fileElem = $manifest.CreateElement('file', $TargetNamespace) $srcAttr = $manifest.CreateAttribute("source") - $srcAttr.Value = $filename + $srcAttr.Value = $filename.Replace('\', '/') $fileElem.Attributes.Append($srcAttr) > $null $dstAttr = $manifest.CreateAttribute("destination") - $dstAttr.Value = $filename + $dstAttr.Value = $filename.Replace('\', '/') $fileElem.Attributes.Append($dstAttr) > $null $manifest.plasterManifest["content"].AppendChild($fileElem) > $null diff --git a/tests/New-PlasterManifest.Tests.ps1 b/tests/New-PlasterManifest.Tests.ps1 index e2b6ebc..6fac221 100644 --- a/tests/New-PlasterManifest.Tests.ps1 +++ b/tests/New-PlasterManifest.Tests.ps1 @@ -142,7 +142,7 @@ Describe 'New-PlasterManifest Command Tests' { } It 'AddContent parameter works' { - $separator = if ($IsWindows) { "\" } else { "/" } + $separator = "/" $expectedManifest = @"