@wipcomputer/wip-ldm-os 0.4.10 → 0.4.11
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/SKILL.md +1 -1
- package/bin/ldm.js +4 -0
- package/package.json +1 -1
package/SKILL.md
CHANGED
package/bin/ldm.js
CHANGED
|
@@ -64,6 +64,9 @@ const LOCK_PATH = join(LDM_ROOT, 'state', '.ldm-install.lock');
|
|
|
64
64
|
|
|
65
65
|
function acquireInstallLock() {
|
|
66
66
|
try {
|
|
67
|
+
// Child processes spawned by `ldm install` inherit this env var
|
|
68
|
+
if (process.env.LDM_INSTALL_LOCK_PID) return true;
|
|
69
|
+
|
|
67
70
|
if (existsSync(LOCK_PATH)) {
|
|
68
71
|
const lock = JSON.parse(readFileSync(LOCK_PATH, 'utf8'));
|
|
69
72
|
// Re-entrant: if we already hold the lock, allow it
|
|
@@ -82,6 +85,7 @@ function acquireInstallLock() {
|
|
|
82
85
|
}
|
|
83
86
|
mkdirSync(dirname(LOCK_PATH), { recursive: true });
|
|
84
87
|
writeFileSync(LOCK_PATH, JSON.stringify({ pid: process.pid, started: new Date().toISOString() }));
|
|
88
|
+
process.env.LDM_INSTALL_LOCK_PID = String(process.pid);
|
|
85
89
|
|
|
86
90
|
// Clean up on exit
|
|
87
91
|
const cleanup = () => { try { if (existsSync(LOCK_PATH)) { const l = JSON.parse(readFileSync(LOCK_PATH, 'utf8')); if (l.pid === process.pid) unlinkSync(LOCK_PATH); } } catch {} };
|