mirror of
https://gitee.com/an-tao/drogon.git
synced 2024-11-30 02:37:57 +08:00
15 lines
319 B
Bash
Executable File
15 lines
319 B
Bash
Executable File
#!/bin/sh
|
|
|
|
GIT_VER=`git log|grep commit|wc -l`
|
|
MD5=`git log|head -1|awk '{printf $2}'`
|
|
TMP_FILE=/tmp/version
|
|
echo "#define VERSION \"0.1.0.$GIT_VER\"" > $TMP_FILE
|
|
echo "#define VERSION_MD5 \"$MD5\"" >> $TMP_FILE
|
|
if [ ! -f $1 ];then
|
|
mv -f $TMP_FILE $1
|
|
else
|
|
diff $TMP_FILE $1
|
|
if [ $? -eq 1 ];then
|
|
mv -f $TMP_FILE $1
|
|
fi
|
|
fi |