]> git.refcnt.org Git - colorize.git/commitdiff
Round version to 2 digits after decimal point
authorSteven Schubiger <stsc@refcnt.org>
Sun, 27 Nov 2016 20:55:47 +0000 (21:55 +0100)
committerSteven Schubiger <stsc@refcnt.org>
Sun, 27 Nov 2016 20:55:47 +0000 (21:55 +0100)
release.sh

index f6da284b94528fd19e217b12a01dbd1b68be9292..b2bbe19bd3aa209e65399f0cdbf3997c118e1a86 100755 (executable)
@@ -2,7 +2,7 @@
 source_file="colorize.c"
 man_file="colorize.1"
 printf '%s\n' "Setting version for $source_file"
-perl -i -pe 's/(?<=#define VERSION ")([^"]+)(?=")/$1+0.01/e' $source_file
+perl -i -pe 's/(?<=#define VERSION ")([^"]+)(?=")/sprintf("%.2f",$1+0.01)/e' $source_file
 printf '%s\n' "Setting version for $man_file"
-perl -i -pe 's/(?<=\.TH COLORIZE 1 "\d{4}-\d{2}-\d{2}" "colorize v)([^"]+)(?=")/$1+0.01/e' $man_file
+perl -i -pe 's/(?<=\.TH COLORIZE 1 "\d{4}-\d{2}-\d{2}" "colorize v)([^"]+)(?=")/sprintf("%.2f",$1+0.01)/e' $man_file
 exit 0