From f2446c0781f80f82fb8eca753888fa59f3c09f7b Mon Sep 17 00:00:00 2001 From: ZioPao Date: Sat, 13 Jul 2024 18:57:10 +0200 Subject: [PATCH] Added script to automatically bump version --- dev_stuff/ci/bump_minor_version.sh | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 dev_stuff/ci/bump_minor_version.sh diff --git a/dev_stuff/ci/bump_minor_version.sh b/dev_stuff/ci/bump_minor_version.sh new file mode 100644 index 0000000..5d5e6c5 --- /dev/null +++ b/dev_stuff/ci/bump_minor_version.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# Open the Main.lua file in read mode +while IFS= read -r line; do + # Check if the current line contains _version + if [[ $line == *_version* ]]; then + # Get the current version number from the line + current_version=$(echo $line | cut -d '"' -f 2) + + # Increment the version number by 1 + new_version=$((current_version + 1)) + + # Replace the old version number with the new one in the file + echo "$line" | sed "s/$current_version/$new_version/g" > media/lua/client/Main.lua + fi +done < media/lua/client/Main.lua + + +# Open the mod.info file in read mode +while IFS= read -r line; do + # Check if the current line contains modversion + if [[ $line == *modversion* ]]; then + # Get the current version number from the line + current_version=$(echo $line | cut -d '"' -f 2) + + # Increment the version number by 1 + new_version=$((current_version + 1)) + + # Replace the old version number with the new one in the file + echo "$line" | sed "s/$current_version/$new_version/g" > mod.info + fi +done < mod.info \ No newline at end of file