Files
minecraft-bedrock-json-schemas/test/src/Utillity.ts
Daan Verstraten 92ad45e510 Trying to fix the pipeline (#161)
* Trying to fix the pipeline

* Fixing pipeline

* Removed mocha-junit-reporter
2023-02-21 19:21:04 +01:00

36 lines
914 B
TypeScript

import FastGlob = require("fast-glob");
import path = require("path");
export namespace Files {
export function TestFolder(): string {
return path.join(__dirname, "..", "..", "test");
}
export function RootFolder(): string {
return path.join(TestFolder(), "..");
}
export function FilesFolder(): string {
return path.join(TestFolder(), "files");
}
export function CorrectFilesFolder(): string {
return path.join(FilesFolder(), "correct");
}
export function InCorrectFilesFolder(): string {
return path.join(FilesFolder(), "incorrect");
}
export function GetFiles(cwd: string): string[] {
if (!cwd.endsWith("/") && !cwd.endsWith("\\")) cwd += "/";
cwd = cwd.replace("\\", "/");
const options: FastGlob.Options = { onlyFiles: true, absolute: true, cwd: cwd };
let entries = FastGlob.sync(["*.json", "**/*.json"], options);
return entries;
}
}