Improve copyFile

This commit is contained in:
TheAssassin
2018-06-11 23:43:21 +02:00
parent ee42183205
commit 5bb8002a09

View File

@@ -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;
}