From bcc78859fcb8b5e102066b2b5562ebedfd2cd708 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 24 May 2025 20:33:55 +1200 Subject: [PATCH] dropshell release 2025.0524.2033 --- source/src/commands/command_registry.cpp | 9 +++++++++ source/src/commands/create-service.cpp | 8 ++++---- source/src/commands/destroy.cpp | 2 +- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/source/src/commands/command_registry.cpp b/source/src/commands/command_registry.cpp index 6798a19..dec3e9f 100644 --- a/source/src/commands/command_registry.cpp +++ b/source/src/commands/command_registry.cpp @@ -20,6 +20,15 @@ void CommandRegistry::register_command(const CommandInfo& info) { const CommandInfo* CommandRegistry::find_command(const std::string& name) const { auto it = command_map_.find(name); if (it != command_map_.end()) return it->second.get(); + + // go deep now. + for (const auto& cmd : all_commands_) { + if (cmd->names.size() > 0) { + for (const auto& altname : cmd->names) { + if (name == altname) return cmd.get(); + } + } + } return nullptr; } diff --git a/source/src/commands/create-service.cpp b/source/src/commands/create-service.cpp index f38a2a2..1ab81a7 100644 --- a/source/src/commands/create-service.cpp +++ b/source/src/commands/create-service.cpp @@ -194,10 +194,10 @@ namespace dropshell info << "Setting SSH_USER to " << sshuser << " in the " << filenames::service_env << " file" << std::endl; { // edit the service.env file to set the SSH_USER. - std::string template_service_env_file = tinfo.local_template_path() / "config" / filenames::service_env; - ASSERT(std::filesystem::exists(template_service_env_file), "Template service env file not found: " + template_service_env_file); - std::ifstream template_service_env_file_in(template_service_env_file); - std::ofstream service_env_file_out(localfile::template_info_env(server_name, service_name)); + std::string source_service_env = tinfo.local_template_path() / "config" / filenames::service_env; + ASSERT(std::filesystem::exists(source_service_env), "Template service env file not found: " + source_service_env); + std::ifstream template_service_env_file_in(source_service_env); + std::ofstream service_env_file_out(localfile::service_env(server_name, service_name)); std::string line; while (std::getline(template_service_env_file_in, line)) { diff --git a/source/src/commands/destroy.cpp b/source/src/commands/destroy.cpp index 0b37a92..6eef57b 100644 --- a/source/src/commands/destroy.cpp +++ b/source/src/commands/destroy.cpp @@ -14,7 +14,7 @@ namespace dropshell { int destroy_handler(const CommandContext &ctx); - static std::vector destroy_name_list = {"destroy"}; + static std::vector destroy_name_list = {"destroy", "nuke", "nuke-service","erase","destroy-service"}; // Static registration struct DestroyCommandRegister