From 8d85031a14e8af277e313f68167fb385c4e04615 Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Mon, 18 Dec 2023 14:39:52 +0100 Subject: [PATCH] Minor tweaks --- cli/plug_run.ts | 2 +- common/spaces/kv_meta_space_primitives.ts | 2 +- server/server_system.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cli/plug_run.ts b/cli/plug_run.ts index d7d2003d..efe4cddb 100644 --- a/cli/plug_run.ts +++ b/cli/plug_run.ts @@ -20,7 +20,7 @@ export async function runPlug( const serverController = new AbortController(); const app = new Application(); - const dbBackend = await determineDatabaseBackend(); + const dbBackend = await determineDatabaseBackend(spacePath); if (!dbBackend) { console.error("Cannot run plugs in databaseless mode."); diff --git a/common/spaces/kv_meta_space_primitives.ts b/common/spaces/kv_meta_space_primitives.ts index 01b9ea19..06ae54de 100644 --- a/common/spaces/kv_meta_space_primitives.ts +++ b/common/spaces/kv_meta_space_primitives.ts @@ -1,6 +1,6 @@ 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 { mime } from "../deps.ts"; import { SpacePrimitives } from "./space_primitives.ts"; export type KvMetaSpacePrimitivesCallbacks = { diff --git a/server/server_system.ts b/server/server_system.ts index 14c0f69e..1a0a2c82 100644 --- a/server/server_system.ts +++ b/server/server_system.ts @@ -36,7 +36,7 @@ import { ShellBackend } from "./shell_backend.ts"; const fileListInterval = 30 * 1000; // 30s -const plugNameExtractRegex = /\/(.+)\.plug\.js$/; +const plugNameExtractRegex = /([^/]+)\.plug\.js$/; export class ServerSystem { system!: System; @@ -181,7 +181,7 @@ export class ServerSystem { async loadPlugs() { for (const { name } of await this.spacePrimitives.fetchFileList()) { - if (name.endsWith(".plug.js")) { + if (plugNameExtractRegex.test(name)) { await this.loadPlugFromSpace(name); } }