From 5455f182d751d97701e329bebf4f4b295dac0683 Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Tue, 26 Oct 2021 23:28:42 +0200 Subject: [PATCH] adding script to patch version strings version strings are "VVVVV" --- scripts/patchVersion.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 scripts/patchVersion.sh diff --git a/scripts/patchVersion.sh b/scripts/patchVersion.sh new file mode 100755 index 0000000..c2b7b94 --- /dev/null +++ b/scripts/patchVersion.sh @@ -0,0 +1,17 @@ +#!/bin/bash -x +# version: VVVVV + +if [ $# -le 1 ] ; then + echo usage: ${0} version_string files ... + exit 0 +fi +version="$1" +shift +files="$*" + +echo ${version} ${files} +which sponge > /dev/null || ( echo "sponge util must be installed" ; exit 0 ) + +for file in ${files}; do + sed "s/V\{5\}/${version}"/ ${file} | sponge ${file} +done \ No newline at end of file