Minor tweaks
This commit is contained in:
parent
291bd740e1
commit
8d85031a14
@ -20,7 +20,7 @@ export async function runPlug(
|
|||||||
const serverController = new AbortController();
|
const serverController = new AbortController();
|
||||||
const app = new Application();
|
const app = new Application();
|
||||||
|
|
||||||
const dbBackend = await determineDatabaseBackend();
|
const dbBackend = await determineDatabaseBackend(spacePath);
|
||||||
|
|
||||||
if (!dbBackend) {
|
if (!dbBackend) {
|
||||||
console.error("Cannot run plugs in databaseless mode.");
|
console.error("Cannot run plugs in databaseless mode.");
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { FileMeta } from "$sb/types.ts";
|
import { FileMeta } from "$sb/types.ts";
|
||||||
|
import { mime } from "https://deno.land/x/mimetypes@v1.0.0/mod.ts";
|
||||||
import { KvPrimitives } from "../../plugos/lib/kv_primitives.ts";
|
import { KvPrimitives } from "../../plugos/lib/kv_primitives.ts";
|
||||||
import { mime } from "../deps.ts";
|
|
||||||
import { SpacePrimitives } from "./space_primitives.ts";
|
import { SpacePrimitives } from "./space_primitives.ts";
|
||||||
|
|
||||||
export type KvMetaSpacePrimitivesCallbacks = {
|
export type KvMetaSpacePrimitivesCallbacks = {
|
||||||
|
@ -36,7 +36,7 @@ import { ShellBackend } from "./shell_backend.ts";
|
|||||||
|
|
||||||
const fileListInterval = 30 * 1000; // 30s
|
const fileListInterval = 30 * 1000; // 30s
|
||||||
|
|
||||||
const plugNameExtractRegex = /\/(.+)\.plug\.js$/;
|
const plugNameExtractRegex = /([^/]+)\.plug\.js$/;
|
||||||
|
|
||||||
export class ServerSystem {
|
export class ServerSystem {
|
||||||
system!: System<SilverBulletHooks>;
|
system!: System<SilverBulletHooks>;
|
||||||
@ -181,7 +181,7 @@ export class ServerSystem {
|
|||||||
|
|
||||||
async loadPlugs() {
|
async loadPlugs() {
|
||||||
for (const { name } of await this.spacePrimitives.fetchFileList()) {
|
for (const { name } of await this.spacePrimitives.fetchFileList()) {
|
||||||
if (name.endsWith(".plug.js")) {
|
if (plugNameExtractRegex.test(name)) {
|
||||||
await this.loadPlugFromSpace(name);
|
await this.loadPlugFromSpace(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user