forked from 77media/video-flow
add
This commit is contained in:
parent
507a354863
commit
e0fbbb0f1e
18
compile.sh
18
compile.sh
@ -12,6 +12,24 @@ echo "Build process started at $(date)" | tee $LOGFILE
|
|||||||
# 获取当前分支名
|
# 获取当前分支名
|
||||||
current_branch=$(git rev-parse --abbrev-ref HEAD)
|
current_branch=$(git rev-parse --abbrev-ref HEAD)
|
||||||
|
|
||||||
|
# 打包之前,需要检查是否在 dev 分支,工作区是否干净,是否和远程分支一致
|
||||||
|
if [ "$(git branch --show-current)" != "dev" ]; then
|
||||||
|
echo "当前分支不是 dev 分支"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 检查工作区是否干净
|
||||||
|
if [ -n "$(git status --porcelain)" ]; then
|
||||||
|
echo "工作区不干净"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 检查远程分支是否和本地分支一致
|
||||||
|
if [ "$(git rev-parse HEAD)" != "$(git rev-parse origin/dev)" ]; then
|
||||||
|
echo "本地分支和远程分支不一致"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# 检查当前分支并运行相应的 npm 命令
|
# 检查当前分支并运行相应的 npm 命令
|
||||||
if [ "$current_branch" = "dev" ]; then
|
if [ "$current_branch" = "dev" ]; then
|
||||||
echo "On dev branch, building project..." | tee -a $LOGFILE
|
echo "On dev branch, building project..." | tee -a $LOGFILE
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user