From 73872207db8b729f46e2991039eb808fdf6ebc53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Thu, 26 Jan 2017 13:12:14 +0100 Subject: [PATCH] Direct download link now links to latest release version Also edited releaseCommon script to update the link in readme as well. --- README.md | 2 +- scripts/releaseCommon.py | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0c84c75..d4afc81 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Build status (on Travis CI) [![Build Status](https://travis-ci.org/philsquared/Catch.svg?branch=master)](https://travis-ci.org/philsquared/Catch) -The latest, single header, version can be downloaded directly using this link +The latest, single header, version can be downloaded directly using this link ## What's the Catch? diff --git a/scripts/releaseCommon.py b/scripts/releaseCommon.py index 14eb235..236bfbd 100644 --- a/scripts/releaseCommon.py +++ b/scripts/releaseCommon.py @@ -75,6 +75,8 @@ class Version: f.write( line + "\n" ) def updateReadmeFile(self): + versionParser = re.compile( r'\*v\d+\.\d+\.\d+\*' ) + downloadParser = re.compile( r'' ) f = open( readmePath, 'r' ) lines = [] for line in f: @@ -82,8 +84,7 @@ class Version: f.close() f = open( readmePath, 'w' ) for line in lines: - if line.startswith( "*v" ): - f.write( '*v{0}*\n'.format( self.getVersionString() ) ) - else: - f.write( line + "\n" ) + line = versionParser.sub( '*v{0}*'.format(self.getVersionString()), line) + line = downloadParser.sub( r''.format(self.getVersionString()) , line) + f.write( line + "\n" )