feat: Update 3 files
This commit is contained in:
@@ -49,8 +49,7 @@ namespace dropshell
|
||||
|
||||
namespace shared_commands
|
||||
{
|
||||
|
||||
bool destroy_service(const std::string &server, const std::string &service)
|
||||
bool destroy_service_remote(const std::string &server, const std::string &service)
|
||||
{
|
||||
ServerConfig server_env(server);
|
||||
|
||||
@@ -120,6 +119,11 @@ namespace dropshell
|
||||
else
|
||||
error << "No valid local server information for server " << server << std::endl;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool destroy_service_local(const std::string &server, const std::string &service)
|
||||
{
|
||||
// step 2 - destroy the local service directory, if it exists.
|
||||
std::string local_service_path = localpath::service(server, service);
|
||||
if (local_service_path.empty() || !std::filesystem::exists(local_service_path))
|
||||
@@ -134,11 +138,20 @@ namespace dropshell
|
||||
else
|
||||
info << "Local service directory removed: " << local_service_path << std::endl;
|
||||
}
|
||||
|
||||
info << "Finished destroying service " << service << " on server " << server << std::endl;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool destroy_service(const std::string &server, const std::string &service)
|
||||
{
|
||||
if (!destroy_service_remote(server, service))
|
||||
return false;
|
||||
if (!destroy_service_local(server, service))
|
||||
return false;
|
||||
|
||||
info << "Finished destroying service " << service << " on server " << server << std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace shared_commands
|
||||
|
||||
int destroy_handler(const CommandContext &ctx)
|
||||
|
Reference in New Issue
Block a user