efc325568d
- 配色体系:256 色语义色板(primary/accent/success/warn/danger)与统一图标常量 - 修复右边框对齐:ctms_text_width 用 perl 精确计算显示宽度,剥离 sgr0 的 \e(B 序列 - 修复菜单闪屏:改用光标归位原地覆盖重绘,去掉每帧清屏 - 美化各面板:install.sh banner/确认/成功框、根菜单、status.sh 资源表格,标签列对齐 - 新增 ctms_pad_right 按显示宽度填充含中文标签 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
41 lines
1.0 KiB
Bash
Executable File
41 lines
1.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
# shellcheck source=scripts/common.sh
|
|
source "$SCRIPT_DIR/common.sh"
|
|
|
|
usage() {
|
|
cat <<EOF
|
|
${C_BOLD}用法:${C_RESET}
|
|
bash scripts/update.sh <环境> [安装脚本选项]
|
|
|
|
${C_BOLD}环境:${C_RESET}
|
|
dev | main | release
|
|
|
|
${C_BOLD}说明:${C_RESET}
|
|
更新流程复用 scripts/install.sh:校验配置、重建/刷新容器、执行迁移并健康检查。
|
|
本脚本不会执行 git pull,请先确认代码已处于目标版本。
|
|
EOF
|
|
}
|
|
|
|
main() {
|
|
if [[ $# -eq 0 ]]; then
|
|
usage
|
|
exit 1
|
|
fi
|
|
|
|
local env="$1"
|
|
shift
|
|
ctms_require_env "$env"
|
|
|
|
local install_script="$CTMS_ROOT_DIR/scripts/install.sh"
|
|
[[ -x "$install_script" ]] || ctms_fail "安装脚本不可执行: $install_script"
|
|
|
|
ctms_info "更新会复用现有安装流程:校验配置、重建容器、执行迁移并健康检查。"
|
|
ctms_info "该命令不会执行 git pull;请先确认代码已处于目标版本。"
|
|
"$install_script" "$env" "$@"
|
|
}
|
|
|
|
main "$@"
|