1 Star 1 Fork 0

WGrape/sparrow

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
_update.sh 1.37 KB
一键复制 编辑 原始数据 按行查看 历史
#!/bin/sh
# this script is basic tool, such as install, uninstall, .etc
# This script is a fundamental operations tool, including installation, uninstallation, updates, etc.
# To maintain consistency and facilitate management, the filenames of these scripts all use the underscore (_) prefix.
# _update.sh
# define the base path of project.
CUR_PATH=$(cd "$(dirname "$0")" && pwd)
SPARROW_BASE_PATH=$CUR_PATH
# cd base dir of project.
# the process is in the same shell as the starting shell.
cd $SPARROW_BASE_PATH
# include sdk of sparrow.
. .work/include/sdk.sh
# update project.
update_project() {
print_stage "git pull..."
if ! git pull; then
print_error "update project failed: git pull error"
exit 1
fi
}
# before run update command.
before_update_command() {
print_stage "do before_update_command..."
# check updatable
if ! git diff --quiet; then
print_error "update failed: please don't modify any files."
exit 1
fi
}
# after run update command.
after_update_command() {
print_stage "do after_update_command..."
}
##################### start script exec flow #####################
# before run update command.
before_update_command
# update project.
update_project
# after run update command.
after_update_command
# end.
print_info "update successfully"
##################### end script exec flow #######################
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Docker
1
https://gitee.com/WGrape/sparrow.git
git@gitee.com:WGrape/sparrow.git
WGrape
sparrow
sparrow
main

搜索帮助