mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add bundle extension updater classes
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
1 parent
de75d9d680
commit
b6d06c8ca3
6 files changed
+98
-4
No files matched your search
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||
*/
|
||||
|
||||
import type { InstalledExtension } from "../extension-discovery/extension-discovery"
|
||||
|
||||
export interface UpdaterDependencies {
|
||||
installFromInput: (input: string) => Promise<void>;
|
||||
}
|
||||
|
||||
export class ExtensionUpdater {
|
||||
constructor(protected dependencies : UpdaterDependencies) {
|
||||
}
|
||||
|
||||
async update({ availableUpdate, manifest }: InstalledExtension): Promise<void> {
|
||||
return new Promise(resolve => {
|
||||
if (availableUpdate) {
|
||||
console.info(`[EXTENSIONS-UPDATER]: Trying to update ${manifest.name} extension`);
|
||||
|
||||
resolve();
|
||||
// TODO: actual install
|
||||
// this.dependencies.installFromInput(availableUpdate.input);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user