fix extract traces
Some checks failed
🏗️ Build and Test JellyTau / Run Tests (push) Successful in 4m10s
Traceability Validation / Check Requirement Traces (push) Successful in 21s
🏗️ Build and Test JellyTau / Build Android APK (push) Failing after 2m20s

This commit is contained in:
Duncan Tourolle 2026-06-21 08:48:39 +02:00
parent 01c6423154
commit 2daee7ec2d

View File

@ -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 TRACES_PATTERN = /TRACES:\s*([^\n]+)/gi;
const REQ_ID_PATTERN = /([A-Z]{2})-(\d{3})/g; const REQ_ID_PATTERN = /([A-Z]{2})-(\d{3})/g;
@ -45,7 +49,7 @@ function extractRequirementIds(tracesString: string): string[] {
} }
function getAllSourceFiles(): string[] { function getAllSourceFiles(): string[] {
const baseDir = "/home/dtourolle/Development/JellyTau"; const baseDir = BASE_DIR;
const patterns = ["src", "src-tauri/src"]; const patterns = ["src", "src-tauri/src"];
const files: string[] = []; const files: string[] = [];
@ -101,7 +105,7 @@ function extractTraces(): TracesData {
}; };
let totalTraces = 0; let totalTraces = 0;
const baseDir = "/home/dtourolle/Development/JellyTau"; const baseDir = BASE_DIR;
const files = getAllSourceFiles(); const files = getAllSourceFiles();