mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 02:22:17 +00:00
FIX:Plugin first fails to install Mac
jira: STUDIO-11242 Change-Id: I9c3484e18c3da75a5dee62523e32ac6ad6c9b207 (cherry picked from commit d5d4dc46386894b636c189da15978df11f8393c0)
This commit is contained in:
@@ -910,6 +910,34 @@ __finished:
|
||||
#endif
|
||||
}
|
||||
|
||||
bool copy_framework(const std::string &from, const std::string &to)
|
||||
{
|
||||
boost::filesystem::path src(from), dst(to);
|
||||
try {
|
||||
if (!boost::filesystem::is_directory(src)) {
|
||||
std::cerr << "Error: Source is not a directory: " << src << std::endl;
|
||||
return false;
|
||||
}
|
||||
boost::filesystem::create_directories(dst);
|
||||
for (boost::filesystem::directory_iterator it(src); it != boost::filesystem::directory_iterator(); ++it) {
|
||||
const auto &entry = it->path();
|
||||
const auto dest_path = dst / entry.filename();
|
||||
|
||||
if (boost::filesystem::is_symlink(entry)) {
|
||||
boost::filesystem::copy_symlink(entry, dest_path);
|
||||
} else if (boost::filesystem::is_directory(entry)) {
|
||||
copy_framework(it->path().string(), dest_path.string());
|
||||
} else {
|
||||
boost::filesystem::copy(entry, dest_path, boost::filesystem::copy_options::overwrite_existing);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} catch (const boost::filesystem::filesystem_error &e) {
|
||||
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << "Filesystem error: " << e.what();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
CopyFileResult check_copy(const std::string &origin, const std::string ©)
|
||||
{
|
||||
boost::nowide::ifstream f1(origin, std::ifstream::in | std::ifstream::binary | std::ifstream::ate);
|
||||
|
||||
Reference in New Issue
Block a user