test: fix inf loop if dirname results in same dir, ie \

This commit is contained in:
Barış Soner Uşaklı
2025-03-10 18:25:53 -04:00
parent c4e3139599
commit 1ca7b7ecce

View File

@@ -81,7 +81,11 @@ async function checkSymLinks(folder) {
if (stat.isSymbolicLink()) {
throw new Error('[[invalid-path]]');
}
dir = path.dirname(dir);
const newDir = path.dirname(dir);
if (newDir === dir) {
break;
}
dir = newDir;
}
}