Normalize fullwidth punctuation to ASCII across codebase.

Add scripts/normalize_ambiguous_unicode.py; fix corrupted patch_instance_theme_templates.py. Preserves curly quotes in string literals; removes Git homoglyph warnings on .env.example.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-08 23:42:26 +08:00
parent aaa72c7961
commit b733e551a0
392 changed files with 71522 additions and 71369 deletions
+17 -17
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# crypto_monitor 一键环境部署Ubuntu / root /opt/crypto_monitor
# crypto_monitor 一键环境部署(Ubuntu / root /opt/crypto_monitor)
#
# 用法:
# bash deploy/setup_env.sh
@@ -10,7 +10,7 @@
#
set -e
set -u
# 避免 Windows CRLF 导致 set -euo pipefail 一行报错pipefail 仅 bash 支持
# 避免 Windows CRLF 导致 set -euo pipefail 一行报错;pipefail 仅 bash 支持
if [ -n "${BASH_VERSION:-}" ]; then
set -o pipefail
fi
@@ -69,7 +69,7 @@ find_python() {
echo python
return
fi
echo "未找到 python3/python请先安装 Python 3.10+" >&2
echo "未找到 python3/python,请先安装 Python 3.10+" >&2
exit 1
}
@@ -81,7 +81,7 @@ check_python_version() {
major="${ver%%.*}"
minor="${ver#*.}"
if [[ "${major}" -lt 3 ]] || [[ "${major}" -eq 3 && "${minor}" -lt 10 ]]; then
echo "需要 Python 3.10+当前: ${ver}" >&2
echo "需要 Python 3.10+,当前: ${ver}" >&2
exit 1
fi
echo "Python: $("${py}" --version 2>&1)"
@@ -109,11 +109,11 @@ install_debian_venv_packages() {
local ver
ver="$(python_minor_version "${py}")"
if ! command -v apt-get >/dev/null 2>&1; then
echo " 未检测到 apt-get请手动安装 python${ver}-venv 与 python3-pip" >&2
echo " 未检测到 apt-get,请手动安装 python${ver}-venv 与 python3-pip" >&2
return 1
fi
if [[ "$(id -u)" -ne 0 ]]; then
echo " 需要 root 安装系统包请执行:" >&2
echo " 需要 root 安装系统包,请执行:" >&2
echo " sudo apt update && sudo apt install -y python${ver}-venv python3-pip curl" >&2
echo " 或: sudo bash deploy/setup_env.sh --install-system-deps" >&2
return 1
@@ -131,7 +131,7 @@ ensure_venv_prereqs() {
if check_venv_available "${py}"; then
return 0
fi
echo " 当前 Python 无法创建 venv缺少 ensurepip常见于未安装 python*-venv" >&2
echo " 当前 Python 无法创建 venv(缺少 ensurepip,常见于未安装 python*-venv)" >&2
if [[ "${INSTALL_APT_DEPS}" -eq 1 ]] || [[ "$(id -u)" -eq 0 ]]; then
install_debian_venv_packages "${py}" || exit 1
if check_venv_available "${py}"; then
@@ -171,7 +171,7 @@ setup_monitor() {
local dir_name="$1"
local proj="${REPO_ROOT}/${dir_name}"
if [[ ! -d "${proj}" ]]; then
echo " 跳过目录不存在: ${dir_name}"
echo " 跳过(目录不存在): ${dir_name}"
return
fi
step "${dir_name}"
@@ -188,7 +188,7 @@ setup_monitor() {
elif [[ -f .env ]]; then
echo " 保留已有 .env"
else
echo " 无 .env.example请手动配置 .env"
echo " 无 .env.example,请手动配置 .env"
fi
fi
mkdir -p static/images/order_charts
@@ -198,7 +198,7 @@ setup_monitor() {
setup_hub() {
local proj="${REPO_ROOT}/manual_trading_hub"
if [[ ! -d "${proj}" ]]; then
echo " 跳过 hub目录不存在"
echo " 跳过 hub(目录不存在)"
return
fi
step "manual_trading_hub"
@@ -219,9 +219,9 @@ install_pm2() {
if [[ "${SKIP_PM2}" -eq 1 ]]; then
return
fi
step "PM2可选"
step "PM2(可选)"
if ! command -v node >/dev/null 2>&1; then
echo " 未检测到 Node.js跳过安装后执行: npm install -g pm2"
echo " 未检测到 Node.js,跳过.安装后执行: npm install -g pm2"
return
fi
if command -v pm2 >/dev/null 2>&1; then
@@ -249,15 +249,15 @@ should_include hub && setup_hub
install_pm2
step "部署密钥首次自动生成不覆盖已有"
step "部署密钥(首次自动生成,不覆盖已有)"
if command -v python3 >/dev/null 2>&1; then
python3 "${REPO_ROOT}/scripts/bootstrap_deploy_secrets.py" || true
else
echo " 跳过 bootstrap_deploy_secrets未找到 python3"
echo " 跳过 bootstrap_deploy_secrets(未找到 python3)"
fi
echo ""
echo "部署完成下一步"
echo " 1. 编辑各子目录 .env交易所 API 等AI 请在中控系统设置配置"
echo " 2. 编辑各目录 .env 后使用 PM2: pm2 start ecosystem.config.cjs见 docs/ubuntu-server.md"
echo "部署完成.下一步:"
echo " 1. 编辑各子目录 .env(交易所 API 等;AI 请在中控系统设置配置)"
echo " 2. 编辑各目录 .env 后使用 PM2: pm2 start ecosystem.config.cjs(见 docs/ubuntu-server.md)"
echo ""