Adding script to update (increment) firmware version number used for scialys app, may be used by any app.

This commit is contained in:
Nathael Pajani 2020-06-11 21:13:12 +02:00
parent f7c37c4aa9
commit 5a35072aad
1 changed files with 21 additions and 0 deletions

21
update_version.sh Executable file
View File

@ -0,0 +1,21 @@
#! /bin/sh
# This script must be run from the application directory which wants to use it
# Check header file and version counter files presence
if [ ! -f .version ] ; then
echo "No initial version counter, setting to version 1"
echo 1 > .version
fi
if [ ! -f version.h ] ; then
echo "Need version.h file"
exit 3
fi
# Read and increment version number
i=$(cat .version)
i=$((i + 1))
echo $i > .version
#update version number in header file
sed -i "s/COMPILE_VERSION.*/COMPILE_VERSION \"$i\"/" version.h