From eba1a3326ab43cd5947948b268596addfd040d60 Mon Sep 17 00:00:00 2001 From: JrMasterModelBuilder Date: Sun, 5 May 2024 02:33:35 -0400 Subject: [PATCH] Handle single file json package info --- util/packages.mjs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/util/packages.mjs b/util/packages.mjs index 5a47a0c2..a28d33f6 100644 --- a/util/packages.mjs +++ b/util/packages.mjs @@ -23,6 +23,11 @@ function compareNames(a, b) { } export async function readPackageFile(f) { + const parts = f.split(/[\\/]/); + if (parts.length === 3) { + return [JSON.parse(await readFile(pathJoin(directory, f), 'utf8'))]; + } + const pre = f.replace(/\.json$/, '').replace(/[\\/]/i, '-'); const pres = [pre]; const m = pre.match(andReg);