mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-19 10:20:17 -06:00
Improve version.sh script
Before making any changes to the gen_version.h file check if the number of the last git commit actually changed. If not don't touch the file. Enable the version.sh script also for debug mode. With the above change the program is not compiled and linked every time again, so there's no reason to not run this. This also fixes a build error for those people just checking out the repository and doing a debug build.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -6,6 +6,7 @@ src/sqlitebrowser
|
||||
src/Makefile*
|
||||
src/debug
|
||||
src/release
|
||||
src/gen_version.h
|
||||
|
||||
libs/*/Makefile*
|
||||
libs/*/debug/
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
#!/bin/sh
|
||||
cd $1
|
||||
echo -n "#define APP_VERSION " > gen_version.h
|
||||
git log -n1 --format="\"%h_git\"" >> gen_version.h
|
||||
|
||||
version=`git log -n1 --format="\"%h_git\""`
|
||||
version_macro="#define APP_VERSION $version"
|
||||
current_file=`cat gen_version.h`
|
||||
|
||||
if [ "$version_macro" != "$current_file" ]; then
|
||||
echo "$version_macro" > gen_version.h
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user