extension: Delete working directory on uninstall (#17127)

Closes #17126 

Release Notes:

- N/A
This commit is contained in:
bestgopher 2024-09-03 21:56:47 +08:00 committed by GitHub
parent 32db140b95
commit 02e96821eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -772,6 +772,7 @@ impl ExtensionStore {
pub fn uninstall_extension(&mut self, extension_id: Arc<str>, cx: &mut ModelContext<Self>) {
let extension_dir = self.installed_dir.join(extension_id.as_ref());
let work_dir = self.wasm_host.work_dir.join(extension_id.as_ref());
let fs = self.fs.clone();
match self.outstanding_operations.entry(extension_id.clone()) {
@ -793,6 +794,15 @@ impl ExtensionStore {
}
});
fs.remove_dir(
&work_dir,
RemoveOptions {
recursive: true,
ignore_if_not_exists: true,
},
)
.await?;
fs.remove_dir(
&extension_dir,
RemoveOptions {