From f24bdc91c8ab5e33b4f7fff3c9c4102d3b98b92b Mon Sep 17 00:00:00 2001 From: Charlie Drage Date: Thu, 23 Feb 2023 16:11:15 -0500 Subject: [PATCH] nit: change directory of extensions storage (#1551) ### What does this PR do? Changes the directory of the extensions storage (used to be `.podman-desktop` to the proper `.local` directory that the other directories use. ### Screenshot/screencast of this PR N/A ### What issues does this PR fix or reference? Fixes https://github.com/containers/podman-desktop/issues/1429 ### How to test this PR? 1. Run `yarn watch` 2. Check that the directory `extensions-storage` was made in `.local/share/podman-desktop` Signed-off-by: Charlie Drage --- packages/main/src/plugin/extension-loader.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/main/src/plugin/extension-loader.ts b/packages/main/src/plugin/extension-loader.ts index 5dab5e4dd0b..26efec1fe92 100644 --- a/packages/main/src/plugin/extension-loader.ts +++ b/packages/main/src/plugin/extension-loader.ts @@ -75,8 +75,14 @@ export class ExtensionLoader { private watcherExtensions = new Map(); private reloadInProgressExtensions = new Map(); private extensionsStoragePath = ''; + + // Plugins directory location private pluginsDirectory = path.resolve(os.homedir(), '.local/share/podman-desktop/plugins'); private pluginsScanDirectory = path.resolve(os.homedir(), '.local/share/podman-desktop/plugins-scanning'); + + // Extensions directory location + private extensionsStorageDirectory = path.resolve(os.homedir(), '.local/share/podman-desktop/extensions-storage'); + constructor( private commandRegistry: CommandRegistry, private menuRegistry: MenuRegistry, @@ -174,9 +180,9 @@ export class ExtensionLoader { }); } - this.extensionsStoragePath = path.resolve(os.homedir(), '.podman-desktop'); - if (!fs.existsSync(this.extensionsStoragePath)) { - fs.mkdirSync(this.extensionsStoragePath); + // Create the extensions storage directory if it does not exist + if (!fs.existsSync(this.extensionsStorageDirectory)) { + fs.mkdirSync(this.extensionsStorageDirectory); } let folders;