@remcp/remcp 0.2.220 → 0.2.222
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/package.json
CHANGED
|
@@ -67,11 +67,25 @@ export function withWindowsUpdateLock(prefix, operation) {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
const onExit = () => removeOwnedLock(directory, token);
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
let released = false;
|
|
71
|
+
const release = () => {
|
|
72
|
+
if (released) return;
|
|
73
|
+
released = true;
|
|
74
74
|
process.removeListener('exit', onExit);
|
|
75
75
|
removeOwnedLock(directory, token);
|
|
76
|
+
};
|
|
77
|
+
process.once('exit', onExit);
|
|
78
|
+
try {
|
|
79
|
+
const result = operation();
|
|
80
|
+
// A future async installer must retain the prefix lock until it settles.
|
|
81
|
+
// Releasing here would let another updater move the same package/shims.
|
|
82
|
+
if (result && typeof result.then === 'function') {
|
|
83
|
+
return Promise.resolve(result).finally(release);
|
|
84
|
+
}
|
|
85
|
+
release();
|
|
86
|
+
return result;
|
|
87
|
+
} catch (error) {
|
|
88
|
+
release();
|
|
89
|
+
throw error;
|
|
76
90
|
}
|
|
77
91
|
}
|