FIX: [STUDIO-3891] not remove unselected config bundles

Change-Id: Ibab65c289b3d0900650b93bf6e9789c271dd3db2
This commit is contained in:
chunmao.guo 2023-08-07 19:48:35 +08:00 committed by Lane.Wei
parent e78812dac4
commit 11fb86a054
1 changed files with 14 additions and 13 deletions

View File

@ -737,19 +737,20 @@ bool GuideFrame::apply_config(AppConfig *app_config, PresetBundle *preset_bundle
BOOST_LOG_TRIVIAL(info) << "No bundles need to be installed from resource directory";
}
if (remove_bundles.size() > 0) {
//remove unused bundles
for (const auto &it : remove_bundles) {
auto vendor_file = vendor_dir/(it + ".json");
auto sub_dir = vendor_dir/(it);
if (fs::exists(vendor_file))
fs::remove(vendor_file);
if (fs::exists(sub_dir))
fs::remove_all(sub_dir);
}
} else {
BOOST_LOG_TRIVIAL(info) << "No bundles need to be removed";
}
// Not remove, because these bundles may be updated
//if (remove_bundles.size() > 0) {
// //remove unused bundles
// for (const auto &it : remove_bundles) {
// auto vendor_file = vendor_dir/(it + ".json");
// auto sub_dir = vendor_dir/(it);
// if (fs::exists(vendor_file))
// fs::remove(vendor_file);
// if (fs::exists(sub_dir))
// fs::remove_all(sub_dir);
// }
//} else {
// BOOST_LOG_TRIVIAL(info) << "No bundles need to be removed";
//}
std::string preferred_model;
std::string preferred_variant;