Permalink
Please sign in to comment.
Browse files
Use adam greens suggestion to simplify the way the git version string…
… is generated
- Loading branch information...
Showing
with
11 additions
and 16 deletions.
- +1 −1 .gitignore
- +0 −8 generate-version.sh
- +0 −6 makefile
- +2 −0 src/generate-version.sh
- +7 −0 src/makefile
- +1 −1 src/{version.cpp.placeholder → version.cpp}
2
.gitignore
8
generate-version.sh
@@ -1,8 +0,0 @@ | ||
-echo "#include \"version.h\"" > src/version.cpp | ||
-echo "const char *Version::get_build(void) const {" >> src/version.cpp | ||
-echo " return \"`git symbolic-ref HEAD 2> /dev/null | cut -b 12-`-`git log --pretty=format:\"%h\" -1`\";" >> src/version.cpp | ||
-echo "}" >> src/version.cpp | ||
-echo "const char *Version::get_build_date(void) const {" >> src/version.cpp | ||
-echo " return __DATE__ \" \" __TIME__;" >> src/version.cpp | ||
-echo "}" >> src/version.cpp | ||
- |
6
makefile
2
src/generate-version.sh
@@ -0,0 +1,2 @@ | ||
+echo `git symbolic-ref HEAD 2> /dev/null | cut -b 12-`-`git log --pretty=format:%h -1` | ||
+touch version.cpp |
7
src/makefile
2
src/version.cpp.placeholder → src/version.cpp
0 comments on commit
e473889