2019-06-27 23:39:15 +02:00
|
|
|
from __future__ import print_function
|
2016-03-27 01:17:55 +01:00
|
|
|
import os
|
|
|
|
import re
|
2011-11-11 21:08:24 +01:00
|
|
|
|
2016-03-27 01:17:55 +01:00
|
|
|
node_version_h = os.path.join(
|
|
|
|
os.path.dirname(__file__),
|
|
|
|
'..',
|
|
|
|
'src',
|
2011-11-11 21:08:24 +01:00
|
|
|
'node_version.h')
|
|
|
|
|
|
|
|
f = open(node_version_h)
|
|
|
|
|
|
|
|
for line in f:
|
2016-03-27 01:17:55 +01:00
|
|
|
if re.match('^#define NODE_MAJOR_VERSION', line):
|
2011-09-14 23:51:49 +02:00
|
|
|
major = line.split()[2]
|
2016-03-27 01:17:55 +01:00
|
|
|
if re.match('^#define NODE_MINOR_VERSION', line):
|
2011-09-14 23:51:49 +02:00
|
|
|
minor = line.split()[2]
|
2016-03-27 01:17:55 +01:00
|
|
|
if re.match('^#define NODE_PATCH_VERSION', line):
|
2011-09-14 23:51:49 +02:00
|
|
|
patch = line.split()[2]
|
2011-11-11 21:08:24 +01:00
|
|
|
|
2018-07-18 18:26:21 +02:00
|
|
|
print('%(major)s.%(minor)s.%(patch)s'% locals())
|