Skip to content

Commit

Permalink
Handle single file json package info
Browse files Browse the repository at this point in the history
  • Loading branch information
JrMasterModelBuilder committed May 5, 2024
1 parent d2ba8d4 commit eba1a33
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions util/packages.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit eba1a33

Please sign in to comment.