@mndrk/agx 1.4.1 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +9 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -160,9 +160,18 @@ function findMemDir(startDir = process.cwd()) {
|
|
|
160
160
|
if (fs.existsSync(indexFile)) {
|
|
161
161
|
try {
|
|
162
162
|
const index = JSON.parse(fs.readFileSync(indexFile, 'utf8'));
|
|
163
|
+
// Exact match
|
|
163
164
|
if (index[startDir]) {
|
|
164
165
|
return globalMem;
|
|
165
166
|
}
|
|
167
|
+
// Check parent directories (for monorepo/subdirectory usage)
|
|
168
|
+
let checkDir = startDir;
|
|
169
|
+
while (checkDir !== path.dirname(checkDir)) {
|
|
170
|
+
checkDir = path.dirname(checkDir);
|
|
171
|
+
if (index[checkDir]) {
|
|
172
|
+
return globalMem;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
166
175
|
} catch {}
|
|
167
176
|
}
|
|
168
177
|
}
|