Add fix to allow for different types of slash to be supported

Maybe updating glob broke it for Windows
This commit is contained in:
Dolan Miu
2023-03-18 23:16:41 +00:00
parent 3bf40ecb33
commit b600fd9324

View File

@ -9,7 +9,7 @@ for (const file of files) {
from: /"@[a-z/-]*"/gi, from: /"@[a-z/-]*"/gi,
to: (match) => { to: (match) => {
const matchSlug = match.replace(/['"]+/g, "").replace(/[@]+/g, "").trim(); const matchSlug = match.replace(/['"]+/g, "").replace(/[@]+/g, "").trim();
const levelCount = file.split("/").length - 2; const levelCount = file.split(/[\/\\]/).length - 2;
const backLevels = Array(levelCount).fill("../").join(""); const backLevels = Array(levelCount).fill("../").join("");
return `"${backLevels}${matchSlug}"`; return `"${backLevels}${matchSlug}"`;