mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add designated folder for extensions (#1245)
* add store for mapping extension names to filesystem paths - add extension mechinism for getting a folder to save files to - add test to make sure that extensions are being loaded - skip extension loading test Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
b94e523ad5
commit
4e6b8ee10e
9 files changed
+119
-32
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import type { InstalledExtension } from "./extension-discovery";
|
||||
import { action, observable, reaction } from "mobx";
|
||||
import { filesystemProvisionerStore } from "../main/extension-filesystem";
|
||||
import logger from "../main/logger";
|
||||
|
||||
export type LensExtensionId = string; // path to manifest (package.json)
|
||||
@@ -39,6 +40,17 @@ export class LensExtension {
|
||||
return this.manifest.version;
|
||||
}
|
||||
|
||||
/**
|
||||
* getExtensionFileFolder returns the path to an already created folder. This
|
||||
* folder is for the sole use of this extension.
|
||||
*
|
||||
* Note: there is no security done on this folder, only obfiscation of the
|
||||
* folder name.
|
||||
*/
|
||||
async getExtensionFileFolder(): Promise<string> {
|
||||
return filesystemProvisionerStore.requestDirectory(this.id);
|
||||
}
|
||||
|
||||
get description() {
|
||||
return this.manifest.description;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user