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