代码拉取完成,页面将自动刷新
同步操作将从 mirrors_uavs3/uavs3e 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/bin/bash
# ============================================================================
# File:
# version.sh
# - get version of repository and generate the file version.h
# ============================================================================
# get version of remote and local repository
shell_dir=""
if [ ! -n "$1" ]; then
shell_dir="."
else
shell_dir=$1
fi
VER_R=`git rev-list origin/master | sort | wc -l | gawk '{print $1}'`
VER_L=`git rev-list HEAD | sort | wc -l | gawk '{print $1}'`
VER_SHA1=`git log -n 1 | head -n 1 | cut -d ' ' -f 2`
major_version="1"
minor_version="2"
type_version="release"
# generate the file version.h
echo "// ===========================================================================" > $shell_dir/version.h
echo "// version.h" >> $shell_dir/version.h
echo "// - collection of version numbers" >> $shell_dir/version.h
echo "// ===========================================================================" >> $shell_dir/version.h
echo "" >> $shell_dir/version.h
echo "#ifndef __VERSION_H__" >> $shell_dir/version.h
echo "#define __VERSION_H__" >> $shell_dir/version.h
echo "" >> $shell_dir/version.h
echo "#define VER_MAJOR $major_version // major version number" >> $shell_dir/version.h
echo "#define VER_MINOR $minor_version // minor version number" >> $shell_dir/version.h
echo "#define VER_BUILD $VER_L // build number" >> $shell_dir/version.h
echo "" >> $shell_dir/version.h
echo "#define VERSION_TYPE \"$type_version\"" >> $shell_dir/version.h
echo "#define VERSION_STR \"$major_version.$minor_version.$VER_L\"" >> $shell_dir/version.h
echo "#define VERSION_SHA1 \"$VER_SHA1\"" >> $shell_dir/version.h
echo "" >> $shell_dir/version.h
echo "#endif // __VERSION_H__" >> $shell_dir/version.h
# show version informations
echo " "
echo " GIT VERSION TOOLS"
echo " ====================="
echo " "
echo " get the code version number of remote & local repository."
echo " "
echo " remote: $VER_R"
echo " local: $VER_L"
echo " SHA-1: $VER_SHA1"
echo " "
echo " remote version $VER_L is added to file version.h, such as:"
echo " "
echo " #define VER_BUILD $VER_L"
echo " "
echo " #define VERSION_SHA1 $VER_SHA1"
echo " "
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。