action_type != ActionType::Undo &&
action_type != ActionType::Clean) ? action_type_ : action_type;
std::string pre_function = GetFunctionName(ProcessType::Pre, type);
- Exec(pre_function, &result, manifest->package);
- if (result) {
- LOG(ERROR) << "Function: " << pre_function << " of plugin "
- << plugin_info_.path() << " failed";
- xmlFreeDoc(plugin_doc_ptr);
- return false;
+ if (!pre_function.empty()) {
+ Exec(pre_function, &result, manifest->package);
+ if (result) {
+ LOG(ERROR) << "Function: " << pre_function << " of plugin "
+ << plugin_info_.path() << " failed";
+ xmlFreeDoc(plugin_doc_ptr);
+ return false;
+ }
}
std::string main_function = GetFunctionName(ProcessType::Main, type);
}
std::string post_function = GetFunctionName(ProcessType::Post, type);
- Exec(post_function, &result, manifest->package);
- if (result) {
- LOG(ERROR) << "Function: " << post_function << " of plugin "
- << plugin_info_.path() << " failed";
- xmlFreeDoc(plugin_doc_ptr);
- return false;
+ if (!post_function.empty()) {
+ Exec(post_function, &result, manifest->package);
+ if (result) {
+ LOG(ERROR) << "Function: " << post_function << " of plugin "
+ << plugin_info_.path() << " failed";
+ xmlFreeDoc(plugin_doc_ptr);
+ return false;
+ }
}
xmlFreeDoc(plugin_doc_ptr);