From 20cbb9c0e4ecf1e09e408db1e2709602a1fa3857 Mon Sep 17 00:00:00 2001 From: Adrian Stevens Date: Wed, 7 Aug 2024 20:32:58 -0700 Subject: [PATCH] Deploy delete fix --- Source/v2/Meadow.Tooling.Core/App/AppManager.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Source/v2/Meadow.Tooling.Core/App/AppManager.cs b/Source/v2/Meadow.Tooling.Core/App/AppManager.cs index 8a6722f3..e8342059 100644 --- a/Source/v2/Meadow.Tooling.Core/App/AppManager.cs +++ b/Source/v2/Meadow.Tooling.Core/App/AppManager.cs @@ -137,9 +137,22 @@ public static async Task DeployApplication( { continue; } - + //the CLI and VS2022 handle the file paths differently, should rationalize in the future logger?.LogInformation($"Deleting '{file}'"); - var folder = string.IsNullOrEmpty(file.Path) ? $"/{MeadowRootFolder}/" : $"/{MeadowRootFolder}/{file.Path}/"; + var folder = string.IsNullOrEmpty(file.Path) ? $"/{MeadowRootFolder}/" : $"{file.Path}"; + if (folder.StartsWith("/") == false) + { + folder = "/" + folder; + } + if (folder.EndsWith("/") == false) + { + folder += "/"; + } + + if (folder.Contains(MeadowRootFolder) == false) + { + folder = $"/{MeadowRootFolder}{folder}"; + } await connection.DeleteFile($"{folder}{file.Name}", cancellationToken); }