lucid-mem 0.3.0 → 0.3.1
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/lib/core.mjs +13 -2
- package/package.json +1 -1
package/lib/core.mjs
CHANGED
|
@@ -24,8 +24,19 @@ export function sh(cmd, args, opts = {}) {
|
|
|
24
24
|
|
|
25
25
|
export const git = (repo, args, opts) => sh('git', ['-C', repo, ...args], opts);
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
// Canonicalize before comparing: git reports the long form of paths
|
|
28
|
+
// while env vars may carry 8.3 aliases (RUNNER~1) or symlinks.
|
|
29
|
+
const canon = (p) => {
|
|
30
|
+
const r = path.resolve(p);
|
|
31
|
+
// .native expands 8.3 aliases and symlinks; plain realpathSync keeps
|
|
32
|
+
// 8.3 names as-is on Windows (verified).
|
|
33
|
+
try {
|
|
34
|
+
return fs.realpathSync.native(r);
|
|
35
|
+
} catch {
|
|
36
|
+
return r;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const samePath = (a, b) => canon(a).toLowerCase() === canon(b).toLowerCase();
|
|
29
40
|
|
|
30
41
|
export function isMemoryRepo(dir) {
|
|
31
42
|
if (!fs.existsSync(path.join(dir, 'MEMORY.md'))) return false;
|