ENH: backup: add logic to cleanup directory under cli

Change-Id: I7a846e362f45d1c7e34bef59be3b2c312799d0d2
This commit is contained in:
lane.wei 2023-02-22 11:46:12 +08:00 committed by Lane.Wei
parent dbe61652c7
commit 6fab32c98b
3 changed files with 29 additions and 1 deletions

View file

@ -311,11 +311,17 @@ static PrinterTechnology get_printer_technology(const DynamicConfig &config)
g_cli_callback_mgr.stop();\
boost::nowide::cout.flush();\
boost::nowide::cerr.flush();\
for (Model &model : m_models) {\
model.remove_backup_path_if_exist();\
}\
return(ret);}
#else
#define flush_and_exit(ret) { boost::nowide::cout << __FUNCTION__ << " found error, exit" << std::endl;\
boost::nowide::cout.flush();\
boost::nowide::cerr.flush();\
for (Model &model : m_models) {\
model.remove_backup_path_if_exist();\
}\
return(ret);}
#endif
@ -2371,6 +2377,9 @@ int CLI::run(int argc, char **argv)
g_cli_callback_mgr.stop();
#endif
for (Model &model : m_models) {
model.remove_backup_path_if_exist();
}
//BBS: flush logs
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ", Finished" << std::endl;
boost::nowide::cout.flush();