From 4cf5b91518b7dd08e0e16b6ef5d1bd0663ad229b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henri=20Hyyryl=C3=A4inen?= Date: Mon, 6 Jan 2025 18:54:39 +0200 Subject: [PATCH] Made deployer ensure target folders exist before deploying so it should hopefully now work finally --- Scripts/Deployer.cs | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/Scripts/Deployer.cs b/Scripts/Deployer.cs index d097c69c..6e552ea9 100644 --- a/Scripts/Deployer.cs +++ b/Scripts/Deployer.cs @@ -421,10 +421,24 @@ private async Task CopyFiles(string targetFolder, CancellationToken cancel await BlazorBootFileHandler.RegenerateCompressedFiles(destination, cancellationToken); } + var clientTarget = Path.Join(targetFolder, "www"); + var serverTarget = Path.Join(targetFolder, "server"); + + try + { + Directory.CreateDirectory(clientTarget); + Directory.CreateDirectory(serverTarget); + } + catch (Exception e) + { + ColourConsole.WriteErrorLine($"Failed to create install target folders: {e}"); + return false; + } + var startInfo = new ProcessStartInfo("rsync"); startInfo.ArgumentList.Add("-hr"); startInfo.ArgumentList.Add(ClientBuiltWebroot); - startInfo.ArgumentList.Add(Path.Join(targetFolder, "www") + "/"); + startInfo.ArgumentList.Add(clientTarget + "/"); startInfo.ArgumentList.Add("--delete"); ColourConsole.WriteNormalLine("Copying client files"); @@ -434,14 +448,15 @@ private async Task CopyFiles(string targetFolder, CancellationToken cancel if (result.ExitCode != 0) { - ColourConsole.WriteErrorLine("Failed to copy files"); + ColourConsole.WriteNormalLine(result.FullOutput); + ColourConsole.WriteErrorLine("Failed to copy files (see above for output)"); return false; } startInfo = new ProcessStartInfo("rsync"); startInfo.ArgumentList.Add("-hr"); startInfo.ArgumentList.Add(ServerBuiltBase); - startInfo.ArgumentList.Add(Path.Join(targetFolder, "server") + "/"); + startInfo.ArgumentList.Add(serverTarget + "/"); startInfo.ArgumentList.Add("--delete"); startInfo.ArgumentList.Add("--exclude"); startInfo.ArgumentList.Add("wwwroot");