mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
cleanup and added a router for installing extensions
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
21917c17e3
commit
cf90044979
9 files changed
+573
-565
No files matched your search
@@ -2,9 +2,7 @@ import AwaitLock from "await-lock";
|
||||
import child_process from "child_process";
|
||||
import fs from "fs-extra";
|
||||
import path from "path";
|
||||
import { autobind } from "../common/utils";
|
||||
import logger from "../main/logger";
|
||||
import { LensProtocolRouter } from "../main/protocol-handler";
|
||||
import { extensionPackagesRoot } from "./extension-loader";
|
||||
|
||||
const logModule = "[EXTENSION-INSTALLER]";
|
||||
@@ -22,13 +20,6 @@ export type PackageJson = {
|
||||
* Installs dependencies for extensions
|
||||
*/
|
||||
export class ExtensionInstaller {
|
||||
|
||||
constructor() {
|
||||
const lpr = LensProtocolRouter.getInstance<LensProtocolRouter>();
|
||||
|
||||
lpr.on("/install-extension", this.protocolHandlerInstall);
|
||||
}
|
||||
|
||||
private installLock = new AwaitLock();
|
||||
|
||||
get extensionPackagesRoot() {
|
||||
@@ -39,11 +30,6 @@ export class ExtensionInstaller {
|
||||
return __non_webpack_require__.resolve("npm/bin/npm-cli");
|
||||
}
|
||||
|
||||
@autobind()
|
||||
protocolHandlerInstall(): void {
|
||||
console.log("Installing");
|
||||
}
|
||||
|
||||
installDependencies(): Promise<void> {
|
||||
return new Promise((resolve, reject) => {
|
||||
logger.info(`${logModule} installing dependencies at ${extensionPackagesRoot()}`);
|
||||
|
||||
Reference in new issue
Block a user