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:
co-authored by
Claude Opus 4.6
parent
b39fbddd84
commit
2a1692250c
@@ -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. **过时检查**
|
1. **过时检查**
|
||||||
|
|||||||
+11
-9
@@ -18,22 +18,24 @@ REPOS_DIR="${REPOS_DIR:-$(cd .. && pwd)}"
|
|||||||
echo ">>> 仓库将克隆到: $REPOS_DIR"
|
echo ">>> 仓库将克隆到: $REPOS_DIR"
|
||||||
mkdir -p "$REPOS_DIR"
|
mkdir -p "$REPOS_DIR"
|
||||||
|
|
||||||
declare -A REPOS=(
|
REPO_LIST=(
|
||||||
[chat-gw]="https://github.com/Fasthei/chat-gw.git"
|
"chat-gw https://github.com/Fasthei/chat-gw.git"
|
||||||
[xiaoshou]="https://github.com/Fasthei/xiaoshou.git"
|
"xiaoshou https://github.com/Fasthei/xiaoshou.git"
|
||||||
[gongdan]="https://github.com/Fasthei/gongdan.git"
|
"gongdan https://github.com/Fasthei/gongdan.git"
|
||||||
[casdoor-internal]="https://github.com/zsbgnw12/casdoor-internal.git"
|
"casdoor-internal https://github.com/zsbgnw12/casdoor-internal.git"
|
||||||
[CloudCostbrank]="https://github.com/zsbgnw12/CloudCostbrank.git"
|
"CloudCostbrank https://github.com/zsbgnw12/CloudCostbrank.git"
|
||||||
[lobechat-enterprise]="https://github.com/zsbgnw12/lobechat-enterprise.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"
|
target="$REPOS_DIR/$name"
|
||||||
if [[ -d "$target/.git" ]]; then
|
if [[ -d "$target/.git" ]]; then
|
||||||
echo " [skip] $name 已存在"
|
echo " [skip] $name 已存在"
|
||||||
else
|
else
|
||||||
echo " [clone] $name"
|
echo " [clone] $name"
|
||||||
git clone "${REPOS[$name]}" "$target"
|
git clone "$url" "$target"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user