Skip to content

Commit f393f2a

Browse files
authored
Only build fsevents on macOS (#322)
1 parent 6a281a7 commit f393f2a

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

install.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const { spawn } = require('child_process');
2+
3+
const rebuildIfDarwin = () => {
4+
if (process.platform !== 'darwin') {
5+
console.log();
6+
console.log(`Skipping 'fsevents' build as platform ${process.platform} is not supported`);
7+
process.exit(0);
8+
} else {
9+
spawn('node-gyp', ['rebuild'], { stdio: 'inherit' });
10+
}
11+
};
12+
13+
rebuildIfDarwin();

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"node": ">= 4.0"
1616
},
1717
"scripts": {
18-
"test": "node ./test/fsevents.js && node ./test/function.js 2> /dev/null"
18+
"test": "node ./test/fsevents.js && node ./test/function.js 2> /dev/null",
19+
"install": "node install.js"
1920
},
2021
"repository": {
2122
"type": "git",

0 commit comments

Comments
 (0)