aboutsummaryrefslogtreecommitdiffhomepage
path: root/binding.gyp
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2015-10-19 17:41:03 -0700
committerGravatar murgatroid99 <mlumish@google.com>2015-10-19 17:56:59 -0700
commitc07c734f451332a1ef18b6667b758f62d28d3e49 (patch)
tree1b5bc76793ab860f9c7653b8c170d4a9c4df55e6 /binding.gyp
parente2a1bf46f975a47497977a19a556dd9f07ae944a (diff)
Changed to a more portable Node version check in binding.gyp
Diffstat (limited to 'binding.gyp')
-rw-r--r--binding.gyp7
1 files changed, 4 insertions, 3 deletions
diff --git a/binding.gyp b/binding.gyp
index 3a3a88187e..de10d9d900 100644
--- a/binding.gyp
+++ b/binding.gyp
@@ -46,10 +46,11 @@
# io.js always reports versions >0 and always exports ALPN symbols.
# Therefore, Node's major version will be truthy if and only if it
# supports ALPN. The output of "node -v" is v[major].[minor].[patch],
- # like "v4.1.1" in a recent version. We use grep to extract just the
- # major version. "4", would be the output for the example.
+ # like "v4.1.1" in a recent version. We use cut to split by period and
+ # take the first field (resulting in "v[major]"), then use cut again
+ # to take all but the first character, removing the "v".
'defines': [
- 'TSI_OPENSSL_ALPN_SUPPORT=<!(node -v | grep -oP "(?<=v)(\d+)(?=\.\d+\.\d+)")'
+ 'TSI_OPENSSL_ALPN_SUPPORT=<!(node --version | cut -d. -f1 | cut -c2-)'
],
'include_dirs': [
'.',