fix: improve bootstrap compatibility and add audit pre-requisites

Use plain arrays instead of associative arrays in bootstrap.sh for
broader shell compatibility; add tool installation prep step to
audit-deps command.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
gongzhiyong
2026-04-24 19:40:27 +08:00
co-authored by Claude Opus 4.6
parent b39fbddd84
commit 2a1692250c
2 changed files with 21 additions and 9 deletions
+10
View File
@@ -18,6 +18,16 @@ argument-hint: [repo-name | all]
## 执行步骤
### 0. 预备(必做,昨晚报告写失败就卡在这步)
```bash
mkdir -p /workspace/ai-ops/reports
# 工具按需安装到 /tmp venv,不污染系统
command -v pip-audit >/dev/null || { python3 -m venv /tmp/auditenv && /tmp/auditenv/bin/pip install pip-audit && export PATH="/tmp/auditenv/bin:$PATH"; }
command -v govulncheck >/dev/null || go install golang.org/x/vuln/cmd/govulncheck@latest
```
对每个目标仓库:
1. **过时检查**
+11 -9
View File
@@ -18,22 +18,24 @@ REPOS_DIR="${REPOS_DIR:-$(cd .. && pwd)}"
echo ">>> 仓库将克隆到: $REPOS_DIR"
mkdir -p "$REPOS_DIR"
declare -A REPOS=(
[chat-gw]="https://github.com/Fasthei/chat-gw.git"
[xiaoshou]="https://github.com/Fasthei/xiaoshou.git"
[gongdan]="https://github.com/Fasthei/gongdan.git"
[casdoor-internal]="https://github.com/zsbgnw12/casdoor-internal.git"
[CloudCostbrank]="https://github.com/zsbgnw12/CloudCostbrank.git"
[lobechat-enterprise]="https://github.com/zsbgnw12/lobechat-enterprise.git"
REPO_LIST=(
"chat-gw https://github.com/Fasthei/chat-gw.git"
"xiaoshou https://github.com/Fasthei/xiaoshou.git"
"gongdan https://github.com/Fasthei/gongdan.git"
"casdoor-internal https://github.com/zsbgnw12/casdoor-internal.git"
"CloudCostbrank https://github.com/zsbgnw12/CloudCostbrank.git"
"lobechat-enterprise https://github.com/zsbgnw12/lobechat-enterprise.git"
)
for name in "${!REPOS[@]}"; do
for entry in "${REPO_LIST[@]}"; do
name="${entry%% *}"
url="${entry#* }"
target="$REPOS_DIR/$name"
if [[ -d "$target/.git" ]]; then
echo " [skip] $name 已存在"
else
echo " [clone] $name"
git clone "${REPOS[$name]}" "$target"
git clone "$url" "$target"
fi
done