Update validate-json.test.ts
This commit is contained in:
parent
da16da1496
commit
23add33145
@ -4,17 +4,7 @@ import path from "path";
|
||||
import { ScriptSchema, type Script } from "@/app/json-editor/_schemas/schemas";
|
||||
import { Metadata } from "@/lib/types";
|
||||
|
||||
const publicJsonPath = path.join(process.cwd(), 'public/json');
|
||||
const getJsonDirectory = async () => {
|
||||
if (!(await fs.stat(publicJsonPath).catch(() => null))) {
|
||||
throw new Error(`JSON path file not found: ${publicJsonPath}`);
|
||||
}
|
||||
const jsonPath = (await fs.readFile(publicJsonPath, "utf-8")).trim();
|
||||
return path.resolve(process.cwd(), jsonPath);
|
||||
};
|
||||
|
||||
|
||||
const jsonDir = await getJsonDirectory();
|
||||
const jsonDir = "public/json";
|
||||
const metadataFileName = "metadata.json";
|
||||
const encoding = "utf-8";
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user