Skip to content

Commit

Permalink
Deploy delete fix
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianstevens committed Aug 8, 2024
1 parent 50fb3b2 commit 20cbb9c
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions Source/v2/Meadow.Tooling.Core/App/AppManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 20cbb9c

Please sign in to comment.