mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 16:25:21 +00:00
Renamed parserFile to getModelFolderContents
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import FieldsArray from "./FieldsArray";
|
||||
import Bundle, { filesSymbol } from "./Bundle";
|
||||
import getModelFolderContents from "./getModelFolderContents";
|
||||
import * as Schemas from "./schemas";
|
||||
import * as Signature from "./Signature";
|
||||
import * as Strings from "./StringsUtils";
|
||||
import { getModelFolderContents } from "./parser";
|
||||
import { Stream } from "stream";
|
||||
import { processDate } from "./utils";
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import { promises as fs } from "fs";
|
||||
* filePaths and the relative buffer
|
||||
*/
|
||||
|
||||
export async function getModelFolderContents(
|
||||
export default async function getModelFolderContents(
|
||||
model: string,
|
||||
): Promise<{ [filePath: string]: Buffer }> {
|
||||
try {
|
||||
@@ -58,12 +58,8 @@ export async function getModelFolderContents(
|
||||
);
|
||||
} else if (err.syscall === "scandir") {
|
||||
// directory reading failed
|
||||
const pathContents = (err.path as string).split(/(\/|\\\?)/);
|
||||
throw new Error(
|
||||
formatMessage(
|
||||
ERROR.MODELF_FILE_NOT_FOUND,
|
||||
pathContents[pathContents.length - 1],
|
||||
),
|
||||
formatMessage(ERROR.MODELF_FILE_NOT_FOUND, err.path),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user