We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 163ac0f commit 70cdd0cCopy full SHA for 70cdd0c
src/util/snap.ts
@@ -19,7 +19,9 @@ export async function isSnap(bin: string) {
19
// & firefox use these. Check the end and see if we recognize it:
20
21
const fileSize = await fs.statFile(binPath);
22
- const stream = fs.createReadStream(binPath, { start: fileSize.size - 100 });
+ const stream = fs.createReadStream(binPath, {
23
+ start: Math.max(fileSize.size - 100, 0)
24
+ });
25
const lastChunkOfFile = (await streamToBuffer(stream)).toString('utf8');
26
27
return lastChunkOfFile.includes('exec /snap/bin/');
0 commit comments