feat(project-root): enhance project root detection with boundary markers (#1545)

This commit is contained in:
Ralph Khreish
2025-12-24 13:26:48 +01:00
committed by GitHub
parent 3f489d8116
commit a0007a3575
7 changed files with 337 additions and 124 deletions

View File

@@ -93,9 +93,12 @@ describe('initTaskMaster', () => {
});
test('should find project root from deeply nested subdirectory', () => {
// Arrange - Create .taskmaster directory in temp dir
// Arrange - Create .taskmaster directory and a boundary marker in temp dir
// The boundary marker (.git) anchors .taskmaster to prevent false matches
// from stray .taskmaster dirs (e.g., in home directory)
const taskMasterDir = path.join(tempDir, TASKMASTER_DIR);
fs.mkdirSync(taskMasterDir, { recursive: true });
fs.mkdirSync(path.join(tempDir, '.git'), { recursive: true });
// Create deeply nested subdirectory and change to it
const deepDir = path.join(tempDir, 'src', 'components', 'ui');