GDevelop
GDevelop copied to clipboard
Delete files not existent in project directory
Fix #4120 : When renaming scenes/extensions/external events/external layouts, duplicate files exist, one with the old name and one with the new name. Similarly, when deleting this items, the respective files are also not removed from the project directory. This is due to the fact that when saving the project, only the existing files in the project editor are written and saved, and nothing more is done. There may still remain old files that should not be there, potentially creating duplicates and confusion. Therefore, when saving, we can resolve this issue by deleting all files from the scenes/extensions/external events/external layouts directories, before writing the correct files.
Hi @DavidMLPalma, Rhanks for the suggested PR!
I feel like this strategy is a bit brutal. We already have issues with users saving their projects in the installation directory and losing their projects because of that (when GDevelop is updated). So I think it's better not to have another potential cause for losing files.
May I suggest that you check if the directory name is in the list splittedProjectFolderNames
in LocalProjectWriter
?
Hi @AlexandreSi , Thanks for your reply!
I totally get your point, and in fact by checking if the directory name is one of those present in the list may lead to a more secure solution. I will change it then.
Hi @AlexandreSi , Thanks a lot for the patience and feedback! I will try to implement all the things you pointed out !
Hi @AlexandreSi ,
Once again, thanks for your help and consideration !