Skip to content

Commit

Permalink
Invalidate Cache on Plugin Uninstall
Browse files Browse the repository at this point in the history
  • Loading branch information
atticuscornett committed Jan 19, 2024
1 parent 8de32ea commit 35eddcb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ function uninstallPlugin(event, pluginName){
console.log("Could not disable plugin.");
}
}
// Clear module cache (allows plugin to be reloaded)
delete require.cache[require.resolve(installedPlugins[getInstalledPluginIndexByPackageName(pluginName)].path)];
fs.rmSync(installedPlugins[getInstalledPluginIndexByPackageName(pluginName)].path, { recursive: true, force: true });
refreshInstalledPlugins();
}
Expand Down

0 comments on commit 35eddcb

Please sign in to comment.