Skip to content

Commit

Permalink
- adds client directory removal
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Biret <[email protected]>
  • Loading branch information
baywet committed Mar 6, 2024
1 parent 4c69e6d commit 0209e79
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,10 @@ public void RemoveDescription(string clientName, string extension = "yml")
if (File.Exists(descriptionFilePath))
File.Delete(descriptionFilePath);
}
public void Clean()
{
var kiotaDirectoryPath = Path.Combine(TargetDirectory, DescriptionsSubDirectoryRelativePath);
if (Path.Exists(kiotaDirectoryPath))
Directory.Delete(kiotaDirectoryPath, true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ public async Task RemoveClientAsync(string clientName, bool cleanOutput = false,
manifest?.ApiDependencies.Remove(clientName);
await workspaceConfigurationStorageService.UpdateWorkspaceConfigurationAsync(wsConfig, manifest, cancellationToken).ConfigureAwait(false);
descriptionStorageService.RemoveDescription(clientName);
if (wsConfig.Clients.Count == 0)
descriptionStorageService.Clean();
}
private static readonly JsonSerializerOptions options = new()
{
Expand Down

0 comments on commit 0209e79

Please sign in to comment.