-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add install script which makes native extension optional
- Loading branch information
Showing
2 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,29 @@ | |||
var spawn = require('child_process').spawn | |||
, exec = require('child_process').exec; | |||
|
|||
var build_native = process.env['npm_package_config_native'] != null ? process.env['npm_package_config_native'] : 'false'; | |||
build_native = build_native == 'true' ? true : false; | |||
if(build_native) { | |||
process.stdout.write("================================================================================\n"); | |||
process.stdout.write("= =\n"); | |||
process.stdout.write("= Building WS with blazing fast native extensions. =\n"); | |||
process.stdout.write("= =\n"); | |||
process.stdout.write("================================================================================\n"); | |||
|
|||
var gyp = spawn('node-gyp', ['rebuild']); | |||
gyp.stdout.on('data', function(data) { | |||
process.stdout.write(data); | |||
}); | |||
gyp.stderr.on('data', function(data) { | |||
process.stdout.write(data); | |||
}); | |||
gyp.on('exit', function(code) {}); | |||
This comment has been minimized.
Sorry, something went wrong. |
|||
} | |||
else { | |||
process.stdout.write("================================================================================\n"); | |||
process.stdout.write("= =\n"); | |||
process.stdout.write("= To install WS with blazing fast native extensions, use =\n"); | |||
process.stdout.write("= <npm install ws --ws:native> =\n"); | |||
process.stdout.write("= =\n"); | |||
process.stdout.write("================================================================================\n"); | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
probably
process.exit(code)
here