Add bundle extension updater classes

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev committed 2022-01-24 14:23:35 +03:00
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);
}
});
}
}