From 233285343a03c489e3e8e26ecadb5185fd3280e8 Mon Sep 17 00:00:00 2001 From: j842 Date: Thu, 4 Sep 2025 12:55:59 +1200 Subject: [PATCH] feat: Update 2 files --- source/src/commands/install.cpp | 14 +++++++++++++- source/src/utils/execute.cpp | 5 +++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/source/src/commands/install.cpp b/source/src/commands/install.cpp index 58ca638..2cc10c4 100644 --- a/source/src/commands/install.cpp +++ b/source/src/commands/install.cpp @@ -154,10 +154,22 @@ namespace dropshell { info << "Running " << service_info.template_name << " install script on " << server << "..." << std::endl; + // Check if install.sh exists on remote + std::string install_script_path = remotepath(server,user).service_template(service) + "/install.sh"; + if (!server_env.check_remote_file_exists(install_script_path, user)) + { + error << "Install script not found on remote server: " << install_script_path << std::endl; + error << "Make sure the template '" << service_info.template_name << "' contains an install.sh script" << std::endl; + return false; + } + shared_commands::cRemoteTempFolder remote_temp_folder(server_env, user); if (!server_env.run_remote_template_command(service, "install", {}, false, {{"TEMP_DIR", remote_temp_folder.path()}})) { - error << "Failed to run install script on " << server << std::endl; + error << "Failed to run install script for service '" << service << "' on server '" << server << "'" << std::endl; + error << "Template: " << service_info.template_name << std::endl; + error << "Script path: " << install_script_path << std::endl; + error << "Check that the script is executable and has no syntax errors" << std::endl; return false; } } diff --git a/source/src/utils/execute.cpp b/source/src/utils/execute.cpp index b55e197..9b95868 100644 --- a/source/src/utils/execute.cpp +++ b/source/src/utils/execute.cpp @@ -184,8 +184,9 @@ namespace dropshell if (!rval && !hasFlag(mode, cMode::Silent)) { - error << "Failed to execute ssh command:" << std::endl; - debug << ssh_cmd.str() + " " + remote_command.construct_cmd(remote_bb64_path) << std::endl; + error << "Failed to execute ssh command" << std::endl; + debug << "SSH command: " << ssh_cmd.str() << std::endl; + debug << "Remote command: " << remote_command.construct_cmd(remote_bb64_path) << std::endl; } return rval; }