2019-06-27 21:39:15 +00:00
|
|
|
from __future__ import print_function
|
2016-03-27 00:17:55 +00:00
|
|
|
import os
|
2011-11-11 20:08:24 +00:00
|
|
|
|
|
|
|
|
2019-09-21 19:54:27 +00:00
|
|
|
def get_major_minor_patch(text):
|
|
|
|
for line in text.splitlines():
|
|
|
|
if line.startswith('#define NODE_MAJOR_VERSION'):
|
|
|
|
major = line.split()[2]
|
|
|
|
elif line.startswith('#define NODE_MINOR_VERSION'):
|
|
|
|
minor = line.split()[2]
|
|
|
|
elif line.startswith('#define NODE_PATCH_VERSION'):
|
|
|
|
patch = line.split()[2]
|
|
|
|
return major, minor, patch
|
2011-11-11 20:08:24 +00:00
|
|
|
|
|
|
|
|
2019-09-21 19:54:27 +00:00
|
|
|
node_version_h = os.path.join(os.path.dirname(__file__),
|
|
|
|
'..',
|
|
|
|
'src',
|
|
|
|
'node_version.h')
|
|
|
|
with open(node_version_h) as in_file:
|
|
|
|
print('.'.join(get_major_minor_patch(in_file.read())))
|