2021-05-21 07:46:17 +00:00
|
|
|
#!/bin/bash
|
2019-11-05 21:33:48 +00:00
|
|
|
|
|
|
|
VERFILE="version.scad"
|
|
|
|
|
2021-05-21 07:46:17 +00:00
|
|
|
if [[ "$(cat "$VERFILE")" =~ BOSL_VERSION.*=.*\[([0-9]+),\ *([0-9]+),\ *([0-9]+)\]\; ]]; then
|
|
|
|
major=${BASH_REMATCH[1]} minor=${BASH_REMATCH[2]} revision=${BASH_REMATCH[3]}
|
|
|
|
new_revision=$(( revision+1 ))
|
2019-11-05 21:33:48 +00:00
|
|
|
|
2021-05-21 07:46:17 +00:00
|
|
|
echo "Current Version: $major.$minor.$revision"
|
|
|
|
echo "New Version: $major.$minor.$new_revision"
|
2019-11-05 21:33:48 +00:00
|
|
|
|
2021-05-21 09:19:14 +00:00
|
|
|
sed -i.bak -e 's/^BOSL_VERSION = .*$/BOSL_VERSION = ['"$major,$minor,$new_revision];/g" "$VERFILE"
|
|
|
|
rm "$VERFILE".bak
|
2021-05-21 07:46:17 +00:00
|
|
|
else
|
|
|
|
echo "Could not extract version number from $VERFILE" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|