bilibili-backup/.rider/sagacheck.sh

29 lines
689 B
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
if [ ! -d "${CI_PROJECT_DIR}/../src" ];then
mkdir ${CI_PROJECT_DIR}/../src
fi
ln -fs ${CI_PROJECT_DIR} ${CI_PROJECT_DIR}/../src
export GOPATH=${CI_PROJECT_DIR}/..
exitCode=0
# CHANGELOG check
echo "====CHANGELOG check:===="
files=`.rider/changefiles.sh "CHANGELOG.md"`
if [[ "${files}" = "" ]]; then
echo "未发现CHANGELOG.md文件变更请'添加'或'修改'CHANGELOG.md"
exit 1
else
echo -e "变更如下:\n${files}"
fi
# BGR rule
echo -e "\n====Bili golang rule check:===="
diffFiles=`.rider/changefiles.sh`
cd $GOPATH/src/go-common
go build ./app/tool/bgr
./bgr -script=./app/tool/bgr -hit=main -type=file ${diffFiles}
exitCode=$?
exit ${exitCode}