From 5bb8002a094bc20942708306eb63da88c6209cfc Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Mon, 11 Jun 2018 23:43:21 +0200 Subject: [PATCH] Improve copyFile --- src/core/appdir.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/appdir.cpp b/src/core/appdir.cpp index 51e1ef7..7717706 100644 --- a/src/core/appdir.cpp +++ b/src/core/appdir.cpp @@ -64,10 +64,12 @@ namespace linuxdeploy { if (!overwrite && bf::exists(to)) { ldLog() << LD_DEBUG << "File exists, skipping:" << to << std::endl; - } else { - bf::copy_file(from, to, bf::copy_option::overwrite_if_exists); + return true; } + + bf::copy_file(from, to, bf::copy_option::overwrite_if_exists); } catch (const bf::filesystem_error& e) { + ldLog() << LD_ERROR << "Failed to copy file " << from << "to" << to << LD_NO_SPACE << ":" << e.what() << std::endl; return false; }