Skip to content
Snippets Groups Projects
Commit ee8038f0 authored by Jan Tattermusch's avatar Jan Tattermusch
Browse files

Merge pull request #3888 from murgatroid99/node_portable_version_check

Changed to a more portable Node version check in binding.gyp
parents 08b14ea3 c07c734f
No related branches found
No related tags found
No related merge requests found
...@@ -46,10 +46,11 @@ ...@@ -46,10 +46,11 @@
# io.js always reports versions >0 and always exports ALPN symbols. # io.js always reports versions >0 and always exports ALPN symbols.
# Therefore, Node's major version will be truthy if and only if it # 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], # 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 # like "v4.1.1" in a recent version. We use cut to split by period and
# major version. "4", would be the output for the example. # take the first field (resulting in "v[major]"), then use cut again
# to take all but the first character, removing the "v".
'defines': [ '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': [ 'include_dirs': [
'.', '.',
......
...@@ -48,10 +48,11 @@ ...@@ -48,10 +48,11 @@
# io.js always reports versions >0 and always exports ALPN symbols. # io.js always reports versions >0 and always exports ALPN symbols.
# Therefore, Node's major version will be truthy if and only if it # 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], # 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 # like "v4.1.1" in a recent version. We use cut to split by period and
# major version. "4", would be the output for the example. # take the first field (resulting in "v[major]"), then use cut again
# to take all but the first character, removing the "v".
'defines': [ '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': [ 'include_dirs': [
'.', '.',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment