Skip to content

Commit

Permalink
Fix copy folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Xzonn committed Oct 11, 2024
1 parent 239d164 commit 08b3397
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions scripts/lib.csx
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,10 @@ void EditBanner(string parentGame, string game, string newTitle)

void CopyFolder(string from, string to, string pattern = "*")
{
if (!Directory.Exists(to))
foreach (var file in Directory.GetFiles(from, pattern, SearchOption.AllDirectories))
{
Directory.CreateDirectory(to);
}
foreach (var file in Directory.GetFiles(from, pattern))
{
var fileTo = Path.Combine(to, Path.GetFileName(file));
var fileTo = Path.Combine(to, Path.GetRelativePath(from, file));
Directory.CreateDirectory(Path.GetDirectoryName(fileTo));
File.Copy(file, fileTo, true);
Console.WriteLine($"Copied: {file} -> {fileTo}");
}
Expand Down

0 comments on commit 08b3397

Please sign in to comment.