Skip to content

Commit c4d79ae

Browse files
committed
fix attribute check
1 parent 9456cf3 commit c4d79ae

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

build/postinstall.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
import path from 'node:path';
2-
import fs from 'node:fs';
1+
import child_process from 'node:child_process';
32

43
import {execute} from './execute.js';
54
import {isMac} from './constants.js';
65

76
async function main() {
87
if (isMac) {
8+
const result = child_process.execFileSync('xattr', ['-l', 'dist/darwin-universal.dawn.node']);
9+
if (!result.toString().includes('com.apple.quarantine')) {
10+
return;
11+
}
12+
913
// The user has already indicated they trust this by installing it,
1014
// This executable can not do anything a JavaScript node script couldn't also do.
1115
await execute('xattr', ['-d', 'com.apple.quarantine', 'dist/darwin-universal.dawn.node']);

0 commit comments

Comments
 (0)