diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2023-02-27 09:54:49 +0200 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2023-03-13 21:37:41 +0100 |
commit | 57dc06087908474e6929abd1e0f3c099799b353d (patch) | |
tree | 33571e32e88e42be6d05200bc0a4e67070a910a9 | |
parent | 7e6bc72f7cfa210f756cda60a8a3e9516470f04d (diff) |
Fix Windows to Windows SSH remote deploy. Fix Windows `execute` exit code.
(cherry picked from commit 94355249c360be694bdb692f357dc017d742aee7)
-rw-r--r-- | platform/windows/export/export_plugin.cpp | 8 | ||||
-rw-r--r-- | platform/windows/os_windows.cpp | 3 |
2 files changed, 9 insertions, 2 deletions
diff --git a/platform/windows/export/export_plugin.cpp b/platform/windows/export/export_plugin.cpp index 22297f4c29..941e72c8f3 100644 --- a/platform/windows/export/export_plugin.cpp +++ b/platform/windows/export/export_plugin.cpp @@ -879,7 +879,11 @@ Error EditorExportPlatformWindows::run(const Ref<EditorExportPreset> &p_preset, print_line("Creating temporary directory..."); ep.step(TTR("Creating temporary directory..."), 2); String temp_dir; +#ifndef WINDOWS_ENABLED err = ssh_run_on_remote(host, port, extra_args_ssh, "powershell -command \\\"\\$tmp = Join-Path \\$Env:Temp \\$(New-Guid); New-Item -Type Directory -Path \\$tmp | Out-Null; Write-Output \\$tmp\\\"", &temp_dir); +#else + err = ssh_run_on_remote(host, port, extra_args_ssh, "powershell -command \"$tmp = Join-Path $Env:Temp $(New-Guid); New-Item -Type Directory -Path $tmp ^| Out-Null; Write-Output $tmp\"", &temp_dir); +#endif if (err != OK || temp_dir.is_empty()) { CLEANUP_AND_RETURN(err); } @@ -891,6 +895,10 @@ Error EditorExportPlatformWindows::run(const Ref<EditorExportPreset> &p_preset, CLEANUP_AND_RETURN(err); } + if (cmd_args.is_empty()) { + cmd_args = " "; + } + { String run_script = p_preset->get("ssh_remote_deploy/run_script"); run_script = run_script.replace("{temp_dir}", temp_dir); diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index d384049fb5..91d2d1e996 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -673,9 +673,8 @@ Error OS_Windows::execute(const String &p_path, const List<String> &p_arguments, } CloseHandle(pipe[0]); // Close pipe read handle. - } else { - WaitForSingleObject(pi.pi.hProcess, INFINITE); } + WaitForSingleObject(pi.pi.hProcess, INFINITE); if (r_exitcode) { DWORD ret2; |