支持ui插件下载&运行

This commit is contained in:
muwoo
2021-12-02 17:55:45 +08:00
parent c2f43bea39
commit 0132a11d7e
32 changed files with 951 additions and 244 deletions

View File

@@ -31,7 +31,7 @@ async function getAppIcon(
const existsnone = fs.existsSync(iconnone);
if (exists) return true;
if (existsnone) return false;
const appName: string = appPath.split("/").pop() ?? "";
const appName: string = appPath.split("/").pop() || "";
const extname: string = path.extname(appName);
const appSubStr: string = appName.split(extname)[0];
const path1 = path.join(appPath, `/Contents/Resources/App.icns`);

View File

@@ -34,7 +34,8 @@ class AdapterHandler {
);
}
this.baseDir = options.baseDir;
this.registry = options.registry ?? "https://registry.npm.taobao.org";
console.log(this.baseDir);
this.registry = options.registry || "https://registry.npm.taobao.org";
}
/**
@@ -68,8 +69,8 @@ class AdapterHandler {
}
// 安装并启动插件
async install(adapters: Array<string>, opts?: any) {
const installCmd = opts.isDev ? "link" : "install";
async install(adapters: Array<string>) {
const installCmd = "install";
// 安装
await this.execCommand(installCmd, adapters);
}