@wipcomputer/wip-ldm-os 0.4.8 → 0.4.10
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 +6 -2
- package/package.json +1 -1
package/SKILL.md
CHANGED
package/bin/ldm.js
CHANGED
|
@@ -66,6 +66,8 @@ function acquireInstallLock() {
|
|
|
66
66
|
try {
|
|
67
67
|
if (existsSync(LOCK_PATH)) {
|
|
68
68
|
const lock = JSON.parse(readFileSync(LOCK_PATH, 'utf8'));
|
|
69
|
+
// Re-entrant: if we already hold the lock, allow it
|
|
70
|
+
if (lock.pid === process.pid) return true;
|
|
69
71
|
// Check if PID is still alive
|
|
70
72
|
try {
|
|
71
73
|
process.kill(lock.pid, 0); // signal 0 = just check if alive
|
|
@@ -73,7 +75,9 @@ function acquireInstallLock() {
|
|
|
73
75
|
console.log(` Wait for it to finish, or remove ~/.ldm/state/.ldm-install.lock`);
|
|
74
76
|
return false;
|
|
75
77
|
} catch {
|
|
76
|
-
// PID is dead, stale lock.
|
|
78
|
+
// PID is dead, stale lock. Auto-clean.
|
|
79
|
+
try { unlinkSync(LOCK_PATH); } catch {}
|
|
80
|
+
console.log(` Cleaned stale install lock (PID ${lock.pid} is dead).`);
|
|
77
81
|
}
|
|
78
82
|
}
|
|
79
83
|
mkdirSync(dirname(LOCK_PATH), { recursive: true });
|
|
@@ -595,7 +599,7 @@ function autoDetectExtensions() {
|
|
|
595
599
|
// ── ldm install (bare): scan system, show real state, update if needed ──
|
|
596
600
|
|
|
597
601
|
async function cmdInstallCatalog() {
|
|
598
|
-
|
|
602
|
+
// No lock here. cmdInstall() already holds it when calling this.
|
|
599
603
|
|
|
600
604
|
autoDetectExtensions();
|
|
601
605
|
|