Skip to content

Commit

Permalink
Try to reduce side effects.
Browse files Browse the repository at this point in the history
  • Loading branch information
D8H committed Nov 27, 2023
1 parent 59e760e commit 4e9a901
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Core/GDCore/IDE/Project/ProjectResourcesCopier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@ bool ProjectResourcesCopier::CopyAllResourcesTo(
bool preserveAbsoluteFilenames,
bool preserveDirectoryStructure) {

// Check if there are some resources with absolute filenames
gd::ResourcesAbsolutePathChecker absolutePathChecker(originalProject.GetResourcesManager(), fs);
gd::ResourceExposer::ExposeWholeProjectResources(originalProject, absolutePathChecker);

auto projectDirectory = fs.DirNameFrom(originalProject.GetProjectFile());
std::cout << "Copying all resources from " << projectDirectory << " to "
<< destinationDirectory << "..." << std::endl;

gd::Project& project = originalProject;
if (!updateOriginalProject) {
std::shared_ptr<gd::Project> clonedProject(new gd::Project(originalProject));
project = *clonedProject;
}

// Check if there are some resources with absolute filenames
gd::ResourcesAbsolutePathChecker absolutePathChecker(project.GetResourcesManager(), fs);
gd::ResourceExposer::ExposeWholeProjectResources(project, absolutePathChecker);

auto projectDirectory = fs.DirNameFrom(project.GetProjectFile());
std::cout << "Copying all resources from " << projectDirectory << " to "
<< destinationDirectory << "..." << std::endl;

// Get the resources to be copied
gd::ResourcesMergingHelper resourcesMergingHelper(project.GetResourcesManager(), fs);
resourcesMergingHelper.SetBaseDirectory(projectDirectory);
Expand Down

0 comments on commit 4e9a901

Please sign in to comment.