fix: Create the directory before you begin trying to copy files to it #157
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There's a current issue with the copy functionality where if the first entry in a directory is a file, the root directory doesn't get made, so the file copy fails. This is commonly seen installing RED4ext for CP2077.
The problematic archive format
In the current functionality, when Lampray tries to copy the red4ext folder over, the first entry it gets is Deployment/Cyberpunk 2077/ext/[archive]/red4ext/LICENSE.txt. It tries to copy it into Deployment/Cyberpunk 2077/Cyberpunk 2777/red4ext/LICENSE.txt where it belongs. However, it does this before the Deployment/Cyberpunk 2077/Cyberpunk 2777/red4ext folder is ever made, meaning the copy fails. This leads to the more important RED4ext.dll never being copyed over.
I've updated the code that before it begins to copy the folder recursively, it creates the destination directory. This happens before any file copies, meaning the destination will now always be there
I've tested this with CP2077 to success. I currently cant test it with BG3, but I dont see it causing any issues there personally