dropshell release 2025.0524.2033
Some checks failed
Dropshell Test / Build_and_Test (push) Failing after 11s

This commit is contained in:
Your Name 2025-05-24 20:33:55 +12:00
parent a5243a7e79
commit bcc78859fc
3 changed files with 14 additions and 5 deletions

View File

@ -20,6 +20,15 @@ void CommandRegistry::register_command(const CommandInfo& info) {
const CommandInfo* CommandRegistry::find_command(const std::string& name) const { const CommandInfo* CommandRegistry::find_command(const std::string& name) const {
auto it = command_map_.find(name); auto it = command_map_.find(name);
if (it != command_map_.end()) return it->second.get(); 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; return nullptr;
} }

View File

@ -194,10 +194,10 @@ namespace dropshell
info << "Setting SSH_USER to " << sshuser << " in the " << filenames::service_env << " file" << std::endl; info << "Setting SSH_USER to " << sshuser << " in the " << filenames::service_env << " file" << std::endl;
{ // edit the service.env file to set the SSH_USER. { // edit the service.env file to set the SSH_USER.
std::string template_service_env_file = tinfo.local_template_path() / "config" / filenames::service_env; std::string source_service_env = 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); ASSERT(std::filesystem::exists(source_service_env), "Template service env file not found: " + source_service_env);
std::ifstream template_service_env_file_in(template_service_env_file); std::ifstream template_service_env_file_in(source_service_env);
std::ofstream service_env_file_out(localfile::template_info_env(server_name, service_name)); std::ofstream service_env_file_out(localfile::service_env(server_name, service_name));
std::string line; std::string line;
while (std::getline(template_service_env_file_in, line)) while (std::getline(template_service_env_file_in, line))
{ {

View File

@ -14,7 +14,7 @@ namespace dropshell
{ {
int destroy_handler(const CommandContext &ctx); int destroy_handler(const CommandContext &ctx);
static std::vector<std::string> destroy_name_list = {"destroy"}; static std::vector<std::string> destroy_name_list = {"destroy", "nuke", "nuke-service","erase","destroy-service"};
// Static registration // Static registration
struct DestroyCommandRegister struct DestroyCommandRegister