From b00c9f18527042a81fb1ee5c31059d3c7de9dd49 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Mon, 29 Dec 2025 18:39:05 +0000 Subject: [PATCH 1/2] chore: Add .worktrees/ to .gitignore for parallel development MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 88f3ca33fc..6a72d69cea 100644 --- a/.gitignore +++ b/.gitignore @@ -399,4 +399,4 @@ FodyWeavers.xsd requirements .claude/settings.local.json -nul \ No newline at end of file +nul.worktrees/ From 7fa7e4a53b50c5b567e41d10ab4713016ad82c47 Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Tue, 30 Dec 2025 02:39:51 +0000 Subject: [PATCH 2/2] fix: Use proper path APIs in Folder.CopyTo() instead of string replacement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace brittle string replacement with Path.GetRelativePath() and Path.Combine() to safely compute destination paths. The previous implementation using dirPath.Replace(this, targetPath) could corrupt paths if the source path substring appeared multiple times. Fixes #1453 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- src/ModularPipelines/FileSystem/Folder.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ModularPipelines/FileSystem/Folder.cs b/src/ModularPipelines/FileSystem/Folder.cs index 0a1c9e0321..5c1dd201b0 100644 --- a/src/ModularPipelines/FileSystem/Folder.cs +++ b/src/ModularPipelines/FileSystem/Folder.cs @@ -111,12 +111,16 @@ public Folder CopyTo(string targetPath) foreach (var dirPath in Directory.EnumerateDirectories(this, "*", SearchOption.AllDirectories)) { - Directory.CreateDirectory(dirPath.Replace(this, targetPath)); + var relativePath = System.IO.Path.GetRelativePath(this, dirPath); + var newPath = System.IO.Path.Combine(targetPath, relativePath); + Directory.CreateDirectory(newPath); } - foreach (var newPath in Directory.EnumerateFiles(this, "*", SearchOption.AllDirectories)) + foreach (var filePath in Directory.EnumerateFiles(this, "*", SearchOption.AllDirectories)) { - System.IO.File.Copy(newPath, newPath.Replace(this, targetPath), true); + var relativePath = System.IO.Path.GetRelativePath(this, filePath); + var newPath = System.IO.Path.Combine(targetPath, relativePath); + System.IO.File.Copy(filePath, newPath, true); } ModuleLogger.Current.LogInformation("Copying Folder: {Source} > {Destination}", this, targetPath);