forked from MapComplete/MapComplete
Add validation scripts
This commit is contained in:
parent
954a948cf3
commit
e16def1464
4 changed files with 145 additions and 30 deletions
20
scripts/ScriptUtils.ts
Normal file
20
scripts/ScriptUtils.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
import {lstatSync, readdirSync} from "fs";
|
||||
|
||||
export default class ScriptUtils {
|
||||
public static readDirRecSync(path): string[] {
|
||||
const result = []
|
||||
for (const entry of readdirSync(path)) {
|
||||
const fullEntry = path + "/" + entry
|
||||
const stats = lstatSync(fullEntry)
|
||||
if (stats.isDirectory()) {
|
||||
// Subdirectory
|
||||
// @ts-ignore
|
||||
result.push(...ScriptUtils.readDirRecSync(fullEntry))
|
||||
} else {
|
||||
result.push(fullEntry)
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue