MAJRO CHANGES!@!!@#

This commit is contained in:
j
2025-12-29 23:35:57 +13:00
parent a183b6814a
commit 7a406168e7
6 changed files with 121 additions and 17 deletions

View File

@@ -71,6 +71,27 @@ namespace dropshell
return execute_local_command("", rsync_cmd, {}, nullptr, (silent ? cMode::Silent : cMode::Defaults));
}
// ------------------------------------------------------------------------------------------------
// rsync_file_to_remote : SHARED COMMAND
// ------------------------------------------------------------------------------------------------
bool rsync_file_to_remote(
const std::string &local_path,
const std::string &remote_path,
const ServerConfig &server_env,
bool silent,
std::string user)
{
ASSERT(!local_path.empty() && !remote_path.empty(), "Local or remote path not specified. Can't rsync.");
ASSERT(std::filesystem::is_block_file(local_path), "Local path is not a file. Can't rsync.");
std::string rsync_cmd = "rsync --mkpath -zpc -e 'ssh -p " + server_env.get_SSH_PORT() + "' " +
quote(local_path) + " " +
quote(user + "@" + server_env.get_SSH_HOST() + ":" +
remote_path);
return execute_local_command("", rsync_cmd, {}, nullptr, (silent ? cMode::Silent : cMode::Defaults));
}
// ------------------------------------------------------------------------------------------------
// get_arch : SHARED COMMAND
// ------------------------------------------------------------------------------------------------