Skip to content

Commit

Permalink
Increase tail size on macOS to handle signing.
Browse files Browse the repository at this point in the history
As it is appended to the end of the file.

From my testing I saw 844000 ish as the `footerPosition`, so going up to
1600000 seemed sane.
  • Loading branch information
bruce-one committed Jan 27, 2024
1 parent 2a31503 commit 5f0dfe5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/patches/boot-nexe.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
const fs = require('fs'),
fd = fs.openSync(process.execPath, 'r'),
stat = fs.fstatSync(fd),
tailSize = Math.min(stat.size, 16000),
defaultTailSize = 16000,
tailSize = Math.min(
stat.size,
require('os').platform() === 'darwin' ? defaultTailSize * 100 : defaultTailSize
),
tailWindow = Buffer.from(Array(tailSize))

fs.readSync(fd, tailWindow, 0, tailSize, stat.size - tailSize)
Expand Down

0 comments on commit 5f0dfe5

Please sign in to comment.