Skip to content

Commit

Permalink
Only build fsevents on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
rajivshah3 committed Apr 24, 2020
1 parent 6a281a7 commit 0ee91db
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
13 changes: 13 additions & 0 deletions install.js
@@ -0,0 +1,13 @@
const { spawn } = require('child_process');

const rebuildIfDarwin = () => {
if (process.platform === 'darwin') {
console.log();
console.log(`Skipping 'fsevents' build as platform ${process.platform} is not supported`);
process.exit(0);
} else {
spawn('node-gyp', ['rebuild'], { stdio: 'inherit' });
}
};

rebuildIfDarwin();
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -15,7 +15,8 @@
"node": ">= 4.0"
},
"scripts": {
"test": "node ./test/fsevents.js && node ./test/function.js 2> /dev/null"
"test": "node ./test/fsevents.js && node ./test/function.js 2> /dev/null",
"install": "node install.js"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit 0ee91db

Please sign in to comment.