f7a720204a
- 移除 GovAI, nomifun-tauri, 算力盒子 的 submodule 引用 - 添加所有子项目的完整源代码 - 保留原始 .git 为 .git.bak 备份
44 lines
1.1 KiB
Bash
44 lines
1.1 KiB
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
TARGET_DIR="${1:-$HOME/Star-Office-UI}"
|
|
REPO_URL="${STAR_OFFICE_REPO_URL:-https://github.com/ringhyacinth/Star-Office-UI.git}"
|
|
|
|
echo "[star-office-setup] target: $TARGET_DIR"
|
|
|
|
if ! command -v python3 >/dev/null 2>&1; then
|
|
echo "ERROR: python3 not found"
|
|
exit 1
|
|
fi
|
|
|
|
if ! command -v git >/dev/null 2>&1; then
|
|
echo "ERROR: git not found"
|
|
exit 1
|
|
fi
|
|
|
|
if [ ! -d "$TARGET_DIR/.git" ]; then
|
|
echo "[star-office-setup] cloning repo..."
|
|
git clone "$REPO_URL" "$TARGET_DIR"
|
|
else
|
|
echo "[star-office-setup] repo exists, skip clone"
|
|
fi
|
|
|
|
cd "$TARGET_DIR"
|
|
|
|
if [ ! -d ".venv" ]; then
|
|
echo "[star-office-setup] creating .venv"
|
|
python3 -m venv .venv
|
|
fi
|
|
|
|
echo "[star-office-setup] installing backend requirements in .venv"
|
|
.venv/bin/python -m pip install --upgrade pip
|
|
.venv/bin/python -m pip install -r backend/requirements.txt
|
|
|
|
if [ ! -f "state.json" ] && [ -f "state.sample.json" ]; then
|
|
cp state.sample.json state.json
|
|
echo "[star-office-setup] created state.json from sample"
|
|
fi
|
|
|
|
echo ""
|
|
echo "[star-office-setup] Done. Proceed to start backend and frontend."
|