diff --git a/scripts/check-sanity.mjs b/scripts/check-sanity.mjs index 5578ed6..0b8a3bb 100644 --- a/scripts/check-sanity.mjs +++ b/scripts/check-sanity.mjs @@ -14,11 +14,12 @@ import { readdirSync, readFileSync, statSync } from "node:fs"; import { join, relative } from "node:path"; +import { fileURLToPath } from "node:url"; const ROOT = process.cwd(); const TARGETS = [".md", ".ts", ".mts", ".cts", ".mjs", ".json", ".yml", ".yaml"]; const SKIP = new Set(["node_modules", "dist", ".git", ".openwar", "coverage"]); -const SELF = relative(ROOT, new URL(import.meta.url).pathname.replace(/^\//, "")); +const SELF = relative(ROOT, fileURLToPath(import.meta.url)); const PATTERNS = [ { name: "windows_user_path", regex: /[A-Za-z]:\\\\Users\\\\[A-Za-z0-9_.-]+/g, allow: [] },