mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-21 01:07:46 +00:00
🔧 Miscellaneous Improvements and Refactoring (#466)
This commit is contained in:
@@ -143,9 +143,28 @@ async function getGeminiMdFilePathsInternalForEachDir(
|
||||
// It's okay if it's not found.
|
||||
}
|
||||
|
||||
// FIX: Only perform the workspace search (upward and downward scans)
|
||||
// if a valid currentWorkingDirectory is provided.
|
||||
if (dir) {
|
||||
// Handle the case where we're in the home directory (dir is empty string or home path)
|
||||
const resolvedDir = dir ? path.resolve(dir) : resolvedHome;
|
||||
const isHomeDirectory = resolvedDir === resolvedHome;
|
||||
|
||||
if (isHomeDirectory) {
|
||||
// For home directory, only check for QWEN.md directly in the home directory
|
||||
const homeContextPath = path.join(resolvedHome, geminiMdFilename);
|
||||
try {
|
||||
await fs.access(homeContextPath, fsSync.constants.R_OK);
|
||||
if (homeContextPath !== globalMemoryPath) {
|
||||
allPaths.add(homeContextPath);
|
||||
if (debugMode)
|
||||
logger.debug(
|
||||
`Found readable home ${geminiMdFilename}: ${homeContextPath}`,
|
||||
);
|
||||
}
|
||||
} catch {
|
||||
// Not found, which is okay
|
||||
}
|
||||
} else if (dir) {
|
||||
// FIX: Only perform the workspace search (upward and downward scans)
|
||||
// if a valid currentWorkingDirectory is provided and it's not the home directory.
|
||||
const resolvedCwd = path.resolve(dir);
|
||||
if (debugMode)
|
||||
logger.debug(
|
||||
|
||||
Reference in New Issue
Block a user