mirror of
https://github.com/rubickCenter/rubick
synced 2025-12-26 04:19:27 +08:00
✨ 支持插件开发者模式
This commit is contained in:
@@ -22,11 +22,13 @@ const API: any = {
|
||||
currentPlugin: null,
|
||||
DBKEY: "RUBICK_DB_DEFAULT",
|
||||
openPlugin({ plugin }, window) {
|
||||
if (API.currentPlugin && API.currentPlugin.name === plugin.name) return;
|
||||
runnerInstance.removeView(window);
|
||||
runnerInstance.init(plugin, window);
|
||||
API.currentPlugin = plugin;
|
||||
},
|
||||
removePlugin(e, window) {
|
||||
API.currentPlugin = null;
|
||||
runnerInstance.removeView(window);
|
||||
},
|
||||
hideMainWindow(arg, window) {
|
||||
|
||||
@@ -1,19 +1,15 @@
|
||||
/* eslint-disable */
|
||||
import path from "path";
|
||||
import {app} from "electron";
|
||||
import fs from "fs";
|
||||
|
||||
const appPath = app.getPath("cache");
|
||||
import { PLUGIN_INSTALL_DIR } from "@/common/constans/main";
|
||||
|
||||
export default () => {
|
||||
// 读取所有插件
|
||||
const totalPlugins = global.LOCAL_PLUGINS.getLocalPlugins();
|
||||
let systemPlugins = totalPlugins.filter((plugin) => plugin.pluginType === "system");
|
||||
const baseDir = path.join(appPath, "./rubick-plugins");
|
||||
|
||||
systemPlugins = systemPlugins.map((plugin) => {
|
||||
const pluginPath = path.resolve(
|
||||
baseDir,
|
||||
PLUGIN_INSTALL_DIR,
|
||||
"node_modules",
|
||||
plugin.name
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user