diff --git a/scripts/extract-traces.ts b/scripts/extract-traces.ts index b9a968a..a473fe0 100644 --- a/scripts/extract-traces.ts +++ b/scripts/extract-traces.ts @@ -36,6 +36,10 @@ interface TracesData { }; } +// Repo root, derived from this script's location (scripts/ -> repo root). +// Must NOT be hardcoded to a developer's machine, or CI checkouts see no files. +const BASE_DIR = path.resolve(import.meta.dir, ".."); + const TRACES_PATTERN = /TRACES:\s*([^\n]+)/gi; const REQ_ID_PATTERN = /([A-Z]{2})-(\d{3})/g; @@ -45,7 +49,7 @@ function extractRequirementIds(tracesString: string): string[] { } function getAllSourceFiles(): string[] { - const baseDir = "/home/dtourolle/Development/JellyTau"; + const baseDir = BASE_DIR; const patterns = ["src", "src-tauri/src"]; const files: string[] = []; @@ -101,7 +105,7 @@ function extractTraces(): TracesData { }; let totalTraces = 0; - const baseDir = "/home/dtourolle/Development/JellyTau"; + const baseDir = BASE_DIR; const files = getAllSourceFiles();