mirror of
https://github.com/Nystik-gh/ignis.git
synced 2026-06-17 04:35:53 +00:00
refactor bridge plugin into virtual module
This commit is contained in:
16
apps/ignis-server/server/routes/bootstrap.js
vendored
16
apps/ignis-server/server/routes/bootstrap.js
vendored
@@ -9,7 +9,6 @@ const fsp = fs.promises;
|
||||
const path = require("path");
|
||||
const zlib = require("zlib");
|
||||
const config = require("../config");
|
||||
const { isBridgePluginInstalled, getIgnisMeta } = require("../bridge-plugin");
|
||||
const { getDiscoveredPlugins } = require("../plugin-system/manager");
|
||||
|
||||
const router = express.Router();
|
||||
@@ -76,20 +75,13 @@ async function walkTree(rootPath) {
|
||||
return { tree, dirMtimes };
|
||||
}
|
||||
|
||||
async function buildVaultInfo(vaultId, vaultPath) {
|
||||
const pluginInstalled = await isBridgePluginInstalled(vaultPath);
|
||||
const ignisMeta = await getIgnisMeta(vaultPath);
|
||||
|
||||
function buildVaultInfo(vaultId, vaultPath) {
|
||||
return {
|
||||
id: vaultId,
|
||||
name: vaultId,
|
||||
path: vaultPath,
|
||||
platform: process.platform,
|
||||
version: config.obsidianVersion,
|
||||
ignisPlugin: {
|
||||
installed: pluginInstalled,
|
||||
prompted: ignisMeta.pluginPrompted || false,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -134,10 +126,8 @@ async function buildEntry(vaultId) {
|
||||
}
|
||||
|
||||
const t0 = Date.now();
|
||||
const [vault, { tree, dirMtimes }] = await Promise.all([
|
||||
buildVaultInfo(vaultId, vaultPath),
|
||||
walkTree(vaultPath),
|
||||
]);
|
||||
const vault = buildVaultInfo(vaultId, vaultPath);
|
||||
const { tree, dirMtimes } = await walkTree(vaultPath);
|
||||
|
||||
const response = {
|
||||
vault,
|
||||
|
||||
Reference in New Issue
Block a user