-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·50 lines (40 loc) · 1.03 KB
/
run.sh
File metadata and controls
executable file
·50 lines (40 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
# 账单转 Beancount 工具 - 快速启动脚本
echo "🚀 账单转 Beancount 工具启动脚本"
echo ""
# 检查 Python
if ! command -v python3 &> /dev/null; then
echo "❌ 错误: 未找到 Python 3"
exit 1
fi
echo "✅ Python 3 已安装"
python3 --version
# 创建虚拟环境(如果不存在)
if [ ! -d "venv" ]; then
echo ""
echo "📦 创建虚拟环境..."
python3 -m venv venv
fi
# 激活虚拟环境
echo "🔧 激活虚拟环境..."
source venv/bin/activate
# 安装/升级依赖
echo ""
echo "📚 安装依赖..."
pip install -q --upgrade pip
pip install -q -r requirements.txt
# 检查 DeepSeek API 密钥
if [ -z "$DEEPSEEK_API_KEY" ]; then
echo ""
echo "⚠️ 注意: 未检测到 DEEPSEEK_API_KEY 环境变量"
echo "首次运行时会提示输入 API 密钥"
fi
echo ""
echo "✨ 所有准备就绪!"
echo ""
echo "🌐 启动应用服务器..."
echo "📍 访问地址: http://localhost:5000"
echo "🛑 按 Ctrl+C 停止服务器"
echo ""
# 启动应用
python app.py