no message

This commit is contained in:
kuaifan 2025-05-24 19:51:40 +08:00
parent 261c051052
commit 9d1d642734

19
cmd
View File

@ -515,7 +515,7 @@ run_install() {
$COMPOSE up php -d
# 安装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
@ -553,13 +553,16 @@ run_update() {
# 确定目标分支
if [[ -n "$target_branch" ]]; then
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 失败"
else
current_branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p')
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
echo "数据库有迁移变动,执行数据库备份..."
exec_judge "run_mysql backup" "数据库备份失败" "数据库备份完成"
@ -591,7 +594,7 @@ run_update() {
fi
# 更新依赖
exec_judge "run_exec php 'composer install --no-dev --optimize-autoloader'" "更新PHP依赖失败"
exec_judge "run_exec php 'composer update --optimize-autoloader'" "更新PHP依赖失败"
else
# 本地更新模式
echo "执行数据库备份..."
@ -612,8 +615,14 @@ run_update() {
# 卸载函数
run_uninstall() {
# 确认卸载
read -rp "确定要卸载(含:删除容器、数据库、日志)吗?(Y/n): " confirm_uninstall
[[ -z ${confirm_uninstall} ]] && confirm_uninstall="Y"
echo ""
echo -e "${RedBG}警告:此操作将永久删除以下内容:${Font}"
echo "- 数据库"
echo "- 应用程序"
echo "- 日志文件"
echo ""
read -rp "确认要继续卸载吗?(y/N): " confirm_uninstall
[[ -z ${confirm_uninstall} ]] && confirm_uninstall="N"
case $confirm_uninstall in
[yY][eE][sS] | [yY])
echo -e "${RedBG}开始卸载...${Font}"