feat: Update 3 files
Some checks failed
Build-Test-Publish / build (linux/amd64) (push) Successful in 50s
Build-Test-Publish / build (linux/arm64) (push) Has been cancelled

This commit is contained in:
Your Name
2025-08-31 16:24:57 +12:00
parent a0f541efcf
commit 52606513ff
3 changed files with 28 additions and 12 deletions

View File

@@ -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)