Skip to content

Commit 895fa3a

Browse files
committed
Simplify and move getnodeversion.py
1 parent e0f10ec commit 895fa3a

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
import sys,re;
2-
for line in sys.stdin:
1+
import os,re;
2+
3+
node_version_h = os.path.join(os.path.dirname(__file__), '..', 'src',
4+
'node_version.h')
5+
6+
f = open(node_version_h)
7+
8+
for line in f:
39
if re.match('#define NODE_MAJOR_VERSION', line):
410
major = line.split()[2]
511
if re.match('#define NODE_MINOR_VERSION', line):
612
minor = line.split()[2]
713
if re.match('#define NODE_PATCH_VERSION', line):
814
patch = line.split()[2]
15+
916
print '{0:s}.{1:s}.{2:s}'.format(major, minor, patch)

tools/osx-dist.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
TOOLS=`dirname $0`
44
ROOT=$TOOLS/..
55

6-
VERSION=`python $TOOLS/msvs/msi/getnodeversion.py < $ROOT/src/node_version.h`
6+
VERSION=`python $TOOLS/getnodeversion.py`
77
CONTENTS=$ROOT/dist-osx
88
PMDOC=$TOOLS/osx-pkg.pmdoc
99
VENDOR='org.nodejs'

vcbuild.bat

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ if errorlevel 1 goto exit
7575
:msi
7676
@rem Skip msi generation if not requested
7777
if not defined msi goto run
78-
python "%~dp0tools\msvs\msi\getnodeversion.py" < "%~dp0src\node_version.h" > "%temp%\node_version.txt"
78+
python "%~dp0tools\getnodeversion.py" > "%temp%\node_version.txt"
7979
if not errorlevel 0 echo Cannot determine current version of node.js & goto exit
8080
for /F "tokens=*" %%i in (%temp%\node_version.txt) do set NODE_VERSION=%%i
8181
msbuild "%~dp0tools\msvs\msi\nodemsi.sln" /t:Clean,Build /p:Configuration=%config% /p:NodeVersion=%NODE_VERSION% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo

0 commit comments

Comments
 (0)