From 57239b17ca4ede1c0a384eeaeb66615d322126ed Mon Sep 17 00:00:00 2001 From: Yutaro Sakamoto Date: Wed, 17 Apr 2024 19:42:13 +0900 Subject: [PATCH] [Add]: add update-version.sh update-version.sh replaces version strings in this repostory with new ones. --- update-version.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 update-version.sh diff --git a/update-version.sh b/update-version.sh new file mode 100755 index 00000000..3b1959a2 --- /dev/null +++ b/update-version.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +tmpfile=$(mktemp) +old_version=$1 +new_version=$2 + +if [ "$old_version" = "" ] || [ "$new_version" = "" ]; then + echo "Error: Specify both the old version number and the new version number" > /dev/stderr + exit 1 +fi + +function update_versions_in_file() +{ + cat $1 | sed -e "s/$old_version/$new_version/g" > $tmpfile + cp $tmpfile $1 +} + +# replace version strings +update_versions_in_file configure.ac +update_versions_in_file README.md +update_versions_in_file README_JP.md +update_versions_in_file libcobj/app/build.gradle.kts +update_versions_in_file libcobj/app/src/main/java/jp/osscons/opensourcecobol/libcobj/Const.java +update_versions_in_file tests/command-line-options.src/info-java-dir.at + +# Rebuild +autoreconf +./configure --prefix=/usr/ +make