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
|
|
|
|
2011-11-14 21:03:23 +01:00
|
|
|
print '%(major)s.%(minor)s.%(patch)s'% locals()
|