chore: automated housekeeping...

This commit is contained in:
Pieter Vander Vennet 2025-10-11 14:03:42 +02:00
parent d3b6c090f3
commit 332f960f86
57 changed files with 2884 additions and 1972 deletions

View file

@ -285,13 +285,13 @@ export default class ScriptUtils {
*/
static detectVariablePaths(path: string) {
const splitPath = path.match(/(.*)\{(.+)\}(.*)/)
if(!splitPath){
return [path]
if (!splitPath) {
return [path]
}
const [_, head] = splitPath
const headPath = head.slice(0, head.lastIndexOf("/"))
const allPossibleMatchingFiles = ScriptUtils.readDirRecSync(headPath)
const pathAsRegex = path.replaceAll(/\{.+}/g, ".+")
return allPossibleMatchingFiles.filter(pth => pth.match(pathAsRegex))
return allPossibleMatchingFiles.filter((pth) => pth.match(pathAsRegex))
}
}