mirror of
https://github.com/Jeuners/ECC.git
synced 2026-09-09 15:02:30 +02:00
fix(tests): resolve 10 failing tests on Windows (#2307)
- resolve-formatter: stop findProjectRoot walk before os.homedir() to avoid mistaking global dotfiles (e.g. ~/.prettierrc) for a project root - instinct-cli-projects: detect python3/python binary at runtime; skip gracefully when Python 3 is unavailable instead of crashing with null status - command-registry: regenerate COMMAND-REGISTRY.json (was stale) Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
00b443eddb
commit
acd078f59e
2 changed files with 23 additions and 1 deletions
|
|
@ -9,6 +9,7 @@
|
|||
'use strict';
|
||||
|
||||
const fs = require('fs');
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
|
||||
// ── Caches (per-process, cleared on next hook invocation) ───────────
|
||||
|
|
@ -58,8 +59,12 @@ const FORMATTER_PACKAGES = {
|
|||
function findProjectRoot(startDir) {
|
||||
if (projectRootCache.has(startDir)) return projectRootCache.get(startDir);
|
||||
|
||||
const homeDir = os.homedir();
|
||||
let dir = startDir;
|
||||
while (dir !== path.dirname(dir)) {
|
||||
// Stop before checking the home directory to avoid treating global
|
||||
// dotfiles (e.g. ~/.prettierrc) as a project root marker.
|
||||
if (dir === homeDir) break;
|
||||
for (const marker of PROJECT_ROOT_MARKERS) {
|
||||
if (fs.existsSync(path.join(dir, marker))) {
|
||||
projectRootCache.set(startDir, dir);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue