072d71425326445589dce97cf51e9587f624db0a
[bachelor-thesis/roomba_tests.git] / svnrevision.sh
1 #!/bin/bash
2 if [ -d .svn ]; then
3 revision=$(svn info|grep Revision|sed 's/Revision: //')
4 stat=$(svn status|grep '^M')
5 elif [ -d .git/svn ]; then
6 revision=$(git svn info|grep Revision|sed 's/Revision: //')
7 stat=$(git status|grep 'modified: ')
8 else
9 echo No SVN working copy!
10 exit 1;
11 fi;
12
13 if [ -n "$stat" ]; then
14 status=" with local changes"
15 else
16 status=""
17 fi;
18
19 echo '// This file is created automatically, your changes will be lost.' > svnrevision.h
20 echo '#define SVNREVISION "r'$revision$status'"' >> svnrevision.h
21
This page took 0.042113 seconds and 3 git commands to generate.