Update get_version.sh

This commit is contained in:
antao 2018-10-02 20:02:43 +08:00
parent a4b8d1d421
commit 3a26cb0f1b
2 changed files with 8 additions and 8 deletions

View File

@ -2,14 +2,14 @@
using namespace api; using namespace api;
//add definition of your processing function here //add definition of your processing function here
void Attachment::get(const HttpRequestPtr& req, void Attachment::get(const HttpRequestPtr& req,
const std::function<void (const HttpResponsePtr &)>&callback) const std::function<void (const HttpResponsePtr &)>&callback)
{ {
auto resp=HttpResponse::newHttpViewResponse("FileUpload",HttpViewData()); auto resp=HttpResponse::newHttpViewResponse("FileUpload",HttpViewData());
callback(resp); callback(resp);
} }
void Attachment::upload(const HttpRequestPtr& req, void Attachment::upload(const HttpRequestPtr& req,
const std::function<void (const HttpResponsePtr &)>&callback) const std::function<void (const HttpResponsePtr &)>&callback)
{ {
FileUpload fileUpload; FileUpload fileUpload;
fileUpload.parse(req); fileUpload.parse(req);

View File

@ -3,15 +3,15 @@
GIT_VER=`git log|grep commit|wc -l|sed -e "s/^ *//"` GIT_VER=`git log|grep commit|wc -l|sed -e "s/^ *//"`
MD5=`git log|head -1|awk '{printf $2}'` MD5=`git log|head -1|awk '{printf $2}'`
TMP_FILE=/tmp/version TMP_FILE=/tmp/version
echo "#define VERSION \"0.9.1.$GIT_VER\"" > $TMP_FILE echo "#define VERSION \"0.9.1.$GIT_VER\"" > ${TMP_FILE}
echo "#define VERSION_MD5 \"$MD5\"" >> $TMP_FILE echo "#define VERSION_MD5 \"$MD5\"" >> ${TMP_FILE}
if [ ! -f $1 ];then if [ ! -f $1 ];then
mv -f $TMP_FILE $1 mv -f ${TMP_FILE} $1
else else
diff $TMP_FILE $1 diff ${TMP_FILE} $1
if [ $? -eq 1 ];then if [ $? -eq 1 ];then
mv -f $TMP_FILE $1 mv -f ${TMP_FILE} $1
else else
rm -f $TMP_FILE rm -f ${TMP_FILE}
fi fi
fi fi