Skip to content
Merged
10 changes: 7 additions & 3 deletions src/ModularPipelines/FileSystem/Folder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,18 @@
{
Directory.CreateDirectory(targetPath);

foreach (var dirPath in Directory.EnumerateDirectories(this, "*", SearchOption.AllDirectories))

Check warning on line 112 in src/ModularPipelines/FileSystem/Folder.cs

View workflow job for this annotation

GitHub Actions / pipeline (macos-latest)

Possible null reference argument for parameter 'path' in 'IEnumerable<string> Directory.EnumerateDirectories(string path, string searchPattern, SearchOption searchOption)'.
{
Directory.CreateDirectory(dirPath.Replace(this, targetPath));
var relativePath = System.IO.Path.GetRelativePath(this, dirPath);

Check warning on line 114 in src/ModularPipelines/FileSystem/Folder.cs

View workflow job for this annotation

GitHub Actions / pipeline (macos-latest)

Possible null reference argument for parameter 'relativeTo' in 'string Path.GetRelativePath(string relativeTo, string path)'.
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))

Check warning on line 119 in src/ModularPipelines/FileSystem/Folder.cs

View workflow job for this annotation

GitHub Actions / pipeline (macos-latest)

Possible null reference argument for parameter 'path' in 'IEnumerable<string> Directory.EnumerateFiles(string path, string searchPattern, SearchOption searchOption)'.
{
System.IO.File.Copy(newPath, newPath.Replace(this, targetPath), true);
var relativePath = System.IO.Path.GetRelativePath(this, filePath);

Check warning on line 121 in src/ModularPipelines/FileSystem/Folder.cs

View workflow job for this annotation

GitHub Actions / pipeline (macos-latest)

Possible null reference argument for parameter 'relativeTo' in 'string Path.GetRelativePath(string relativeTo, string path)'.
var newPath = System.IO.Path.Combine(targetPath, relativePath);
System.IO.File.Copy(filePath, newPath, true);
}

ModuleLogger.Current.LogInformation("Copying Folder: {Source} > {Destination}", this, targetPath);
Expand Down
Loading