From b265d2461ed68b8be310a593622b7ff930395fb0 Mon Sep 17 00:00:00 2001 From: zhanghaochen Date: Thu, 30 May 2024 10:38:04 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=89=88=E6=9C=AC=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=87=86=E5=88=99=E4=BF=AE=E6=94=B9=EF=BC=9A=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E6=9C=80=E6=96=B0commitID=EF=BC=9B=E8=8B=A5=E5=AD=98?= =?UTF-8?q?=E5=9C=A8tag=EF=BC=8C=E8=8E=B7=E5=8F=96tag=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=EF=BC=9B=E8=8B=A5=E4=B8=8D=E5=AD=98=E5=9C=A8tag=EF=BC=8Ctag?= =?UTF-8?q?=E4=B8=BANULL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index a6c443a..6c799b6 100755 --- a/build.sh +++ b/build.sh @@ -15,10 +15,18 @@ cache_option="no" test_option="no" case_id=0 board_option="EVB" -arm_version=`git log -1 --format="%H"` -arm_tag=`git tag | sed -n '$p'` +arm_version=`git log --decorate -1 | sed -n '1p' | awk '{print substr($2,0)}'` arm_build_date=`date +"%Y-%m-%d-%H:%M:%S"` +#判断tag是否存在 +if [ -z `git log --decorate -1 | grep -oP '(?<=tag: ).*'` ] + then + arm_tag="NULL"; + else + arm_tag=`git log --decorate -1 | grep -oP '(?<=tag: ).*'` + arm_tag=${arm_tag%?} +fi + while [[ "$#" > 0 ]]; do case $1 in --cache) cache_option="yes"; shift;;