diff options
-rw-r--r-- | tools/getnodeversion.py (renamed from tools/msvs/msi/getnodeversion.py) | 11 | ||||
-rwxr-xr-x | tools/osx-dist.sh | 2 | ||||
-rw-r--r-- | vcbuild.bat | 2 |
3 files changed, 11 insertions, 4 deletions
diff --git a/tools/msvs/msi/getnodeversion.py b/tools/getnodeversion.py index 551d95d0e00..ddcecec46fc 100644 --- a/tools/msvs/msi/getnodeversion.py +++ b/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) diff --git a/tools/osx-dist.sh b/tools/osx-dist.sh index 98fb23203ea..44849748bcc 100755 --- a/tools/osx-dist.sh +++ b/tools/osx-dist.sh @@ -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' diff --git a/vcbuild.bat b/vcbuild.bat index 1f9713126f6..589762e4481 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -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 |