@beads/bd 0.61.0 → 0.62.0
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 +1 -1
- package/scripts/postinstall.js +14 -1
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -172,7 +172,20 @@ async function extractZip(zipPath, destDir, binaryName) {
|
|
|
172
172
|
// The binary should now be in destDir
|
|
173
173
|
const extractedBinary = path.join(destDir, binaryName);
|
|
174
174
|
|
|
175
|
-
|
|
175
|
+
// Windows NTFS metadata visibility lag: fs.existsSync may return false
|
|
176
|
+
// immediately after Expand-Archive returns (GH#2741, same class as #1683).
|
|
177
|
+
// Poll with short delay before concluding the binary is missing.
|
|
178
|
+
let found = fs.existsSync(extractedBinary);
|
|
179
|
+
if (!found && os.platform() === 'win32') {
|
|
180
|
+
for (let poll = 0; poll < 10; poll++) {
|
|
181
|
+
await sleep(200);
|
|
182
|
+
if (fs.existsSync(extractedBinary)) {
|
|
183
|
+
found = true;
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
if (!found) {
|
|
176
189
|
throw new Error(`Binary not found after extraction: ${extractedBinary}`);
|
|
177
190
|
}
|
|
178
191
|
|