From 045733d188b152149c23dccef943b4b5d98d391f Mon Sep 17 00:00:00 2001 From: WerWolv Date: Tue, 12 Dec 2023 12:15:32 +0100 Subject: [PATCH] fix: Auto extractor overwriting existing files --- plugins/builtin/source/content/file_extraction.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/builtin/source/content/file_extraction.cpp b/plugins/builtin/source/content/file_extraction.cpp index 147d428a6..501157cc8 100644 --- a/plugins/builtin/source/content/file_extraction.cpp +++ b/plugins/builtin/source/content/file_extraction.cpp @@ -8,8 +8,11 @@ namespace hex::plugin::builtin { void extractBundledFiles() { for (const auto &romfsPath : romfs::list("auto_extract")) { for (const auto &imhexPath : fs::getDataPaths()) { - wolv::io::File file(imhexPath / std::fs::relative(romfsPath, "auto_extract"), wolv::io::File::Mode::Create); + const auto path = imhexPath / std::fs::relative(romfsPath, "auto_extract"); + if (wolv::io::fs::exists(path)) + continue; + wolv::io::File file(path, wolv::io::File::Mode::Create); if (!file.isValid()) continue;