Permalink
Browse files

Simplify and move getnodeversion.py

  • Loading branch information...
1 parent e0f10ec commit 895fa3a56bd74d7bbf6ee575408ab659ee51085c @ry ry committed Nov 11, 2011
Showing with 11 additions and 4 deletions.
  1. +9 −2 tools/{msvs/msi → }/getnodeversion.py
  2. +1 −1 tools/osx-dist.sh
  3. +1 −1 vcbuild.bat
@@ -1,9 +1,16 @@
-import sys,re;
-for line in sys.stdin:
+import os,re;
+
+node_version_h = os.path.join(os.path.dirname(__file__), '..', 'src',
+ 'node_version.h')
+
+f = open(node_version_h)
+
+for line in f:
if re.match('#define NODE_MAJOR_VERSION', line):
major = line.split()[2]
if re.match('#define NODE_MINOR_VERSION', line):
minor = line.split()[2]
if re.match('#define NODE_PATCH_VERSION', line):
patch = line.split()[2]
+
print '{0:s}.{1:s}.{2:s}'.format(major, minor, patch)
View
@@ -3,7 +3,7 @@
TOOLS=`dirname $0`
ROOT=$TOOLS/..
-VERSION=`python $TOOLS/msvs/msi/getnodeversion.py < $ROOT/src/node_version.h`
+VERSION=`python $TOOLS/getnodeversion.py`
CONTENTS=$ROOT/dist-osx
PMDOC=$TOOLS/osx-pkg.pmdoc
VENDOR='org.nodejs'
View
@@ -75,7 +75,7 @@ if errorlevel 1 goto exit
:msi
@rem Skip msi generation if not requested
if not defined msi goto run
-python "%~dp0tools\msvs\msi\getnodeversion.py" < "%~dp0src\node_version.h" > "%temp%\node_version.txt"
+python "%~dp0tools\getnodeversion.py" > "%temp%\node_version.txt"
if not errorlevel 0 echo Cannot determine current version of node.js & goto exit
for /F "tokens=*" %%i in (%temp%\node_version.txt) do set NODE_VERSION=%%i
msbuild "%~dp0tools\msvs\msi\nodemsi.sln" /t:Clean,Build /p:Configuration=%config% /p:NodeVersion=%NODE_VERSION% /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo

0 comments on commit 895fa3a

Please sign in to comment.