extension: Delete working directory on uninstall (#17127)
Closes #17126 Release Notes: - N/A
This commit is contained in:
parent
32db140b95
commit
02e96821eb
1 changed files with 10 additions and 0 deletions
|
@ -772,6 +772,7 @@ impl ExtensionStore {
|
||||||
|
|
||||||
pub fn uninstall_extension(&mut self, extension_id: Arc<str>, cx: &mut ModelContext<Self>) {
|
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 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();
|
let fs = self.fs.clone();
|
||||||
|
|
||||||
match self.outstanding_operations.entry(extension_id.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(
|
fs.remove_dir(
|
||||||
&extension_dir,
|
&extension_dir,
|
||||||
RemoveOptions {
|
RemoveOptions {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue