Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Simplify and move getnodeversion.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Nov 11, 2011
1 parent e0f10ec commit 895fa3a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
11 changes: 9 additions & 2 deletions tools/msvs/msi/getnodeversion.py → tools/getnodeversion.py
@@ -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)
2 changes: 1 addition & 1 deletion tools/osx-dist.sh
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion vcbuild.bat
Expand Up @@ -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
Expand Down

0 comments on commit 895fa3a

Please sign in to comment.