mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 11:19:56 +00:00
no message
This commit is contained in:
parent
261c051052
commit
9d1d642734
19
cmd
19
cmd
@ -515,7 +515,7 @@ run_install() {
|
|||||||
$COMPOSE up php -d
|
$COMPOSE up php -d
|
||||||
|
|
||||||
# 安装PHP依赖
|
# 安装PHP依赖
|
||||||
exec_judge "run_exec php 'composer install --no-dev --optimize-autoloader'" "安装依赖失败"
|
exec_judge "run_exec php 'composer install --optimize-autoloader'" "安装依赖失败"
|
||||||
|
|
||||||
# 最终检查
|
# 最终检查
|
||||||
if [ ! -f "${WORK_DIR}/vendor/autoload.php" ]; then
|
if [ ! -f "${WORK_DIR}/vendor/autoload.php" ]; then
|
||||||
@ -553,13 +553,16 @@ run_update() {
|
|||||||
# 确定目标分支
|
# 确定目标分支
|
||||||
if [[ -n "$target_branch" ]]; then
|
if [[ -n "$target_branch" ]]; then
|
||||||
current_branch="$target_branch"
|
current_branch="$target_branch"
|
||||||
|
if ! git show-ref --verify --quiet refs/heads/$target_branch; then
|
||||||
|
exec_judge "git fetch origin $target_branch:$target_branch" "获取远程分支 $target_branch 失败"
|
||||||
|
fi
|
||||||
exec_judge "git checkout $target_branch" "切换分支到 $target_branch 失败"
|
exec_judge "git checkout $target_branch" "切换分支到 $target_branch 失败"
|
||||||
else
|
else
|
||||||
current_branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p')
|
current_branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p')
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# 检查数据库迁移变动
|
# 检查数据库迁移变动
|
||||||
db_changes=$(git diff --name-only HEAD..origin/$current_branch | grep -E "^database/" || true)
|
db_changes=$(git diff --name-only HEAD..origin/$current_branch 2>/dev/null | grep -E "^database/" || true)
|
||||||
if [[ -n "$db_changes" ]]; then
|
if [[ -n "$db_changes" ]]; then
|
||||||
echo "数据库有迁移变动,执行数据库备份..."
|
echo "数据库有迁移变动,执行数据库备份..."
|
||||||
exec_judge "run_mysql backup" "数据库备份失败" "数据库备份完成"
|
exec_judge "run_mysql backup" "数据库备份失败" "数据库备份完成"
|
||||||
@ -591,7 +594,7 @@ run_update() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# 更新依赖
|
# 更新依赖
|
||||||
exec_judge "run_exec php 'composer install --no-dev --optimize-autoloader'" "更新PHP依赖失败"
|
exec_judge "run_exec php 'composer update --optimize-autoloader'" "更新PHP依赖失败"
|
||||||
else
|
else
|
||||||
# 本地更新模式
|
# 本地更新模式
|
||||||
echo "执行数据库备份..."
|
echo "执行数据库备份..."
|
||||||
@ -612,8 +615,14 @@ run_update() {
|
|||||||
# 卸载函数
|
# 卸载函数
|
||||||
run_uninstall() {
|
run_uninstall() {
|
||||||
# 确认卸载
|
# 确认卸载
|
||||||
read -rp "确定要卸载(含:删除容器、数据库、日志)吗?(Y/n): " confirm_uninstall
|
echo ""
|
||||||
[[ -z ${confirm_uninstall} ]] && confirm_uninstall="Y"
|
echo -e "${RedBG}警告:此操作将永久删除以下内容:${Font}"
|
||||||
|
echo "- 数据库"
|
||||||
|
echo "- 应用程序"
|
||||||
|
echo "- 日志文件"
|
||||||
|
echo ""
|
||||||
|
read -rp "确认要继续卸载吗?(y/N): " confirm_uninstall
|
||||||
|
[[ -z ${confirm_uninstall} ]] && confirm_uninstall="N"
|
||||||
case $confirm_uninstall in
|
case $confirm_uninstall in
|
||||||
[yY][eE][sS] | [yY])
|
[yY][eE][sS] | [yY])
|
||||||
echo -e "${RedBG}开始卸载...${Font}"
|
echo -e "${RedBG}开始卸载...${Font}"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user