Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy Dalamud to dev folder recursively #1359

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/XIVLauncher.Common/Dalamud/DalamudUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,15 @@ private static void WriteVersionJson(DirectoryInfo addonPath, string info)
File.WriteAllText(Path.Combine(addonPath.FullName, "version.json"), info);
}

public static void CopyFilesRecursively(DirectoryInfo source, DirectoryInfo target)
{
foreach (DirectoryInfo dir in source.GetDirectories())
CopyFilesRecursively(dir, target.CreateSubdirectory(dir.Name));

foreach (FileInfo file in source.GetFiles())
file.CopyTo(Path.Combine(target.FullName, file.Name));
}

private async Task DownloadDalamud(DirectoryInfo addonPath, DalamudVersionInfo version)
{
// Ensure directory exists
Expand Down Expand Up @@ -433,10 +442,7 @@ private async Task DownloadDalamud(DirectoryInfo addonPath, DalamudVersionInfo v
devPath.Create();
}

foreach (var fileInfo in addonPath.GetFiles())
{
fileInfo.CopyTo(Path.Combine(devPath.FullName, fileInfo.Name));
}
CopyFilesRecursively(addonPath, devPath);
}
catch (Exception ex)
{
Expand Down