Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions commandLine/src/projects/baseProject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,15 @@ void baseProject::copyAddonData(ofAddon& addon){

if(fs::exists(from)){
fs::path to { dest / d };
// bin/data (and any folders in ADDON_DATA) may not exist yet (#619)
fs::path toDir { fs::is_directory(from) ? to : to.parent_path() };
if (!fs::exists(toDir)) {
try {
fs::create_directories(toDir);
} catch (const std::exception& e) {
ofLogWarning() << "Can not create addon data folder: " << toDir.string() << " :: " << e.what();
}
}
if (fs::is_regular_file(from)){
try {
fs::copy_file(from, to, fs::copy_options::overwrite_existing); // this is addon files
Expand All @@ -655,14 +664,6 @@ void baseProject::copyAddonData(ofAddon& addon){
}

} else if (fs::is_directory(from)) {
if (!fs::exists(to)) {
try {
fs::create_directory(to);
} catch (const std::exception& e) {
std::cerr << "Error creating directories: " << e.what() << std::endl;
}
}

try {
fs::copy(from, to, fs::copy_options::overwrite_existing | fs::copy_options::recursive);
ofLogVerbose() << "adding addon data file: " << d << endl;
Expand Down
Loading