更新安装脚本,修改启动提示信息以确保用户手动启动,移除自动启动功能,提升用户交互体验。同时,简化输入支持检测逻辑,确保在不同环境下的兼容性。

This commit is contained in:
discountry
2025-09-24 23:11:17 +08:00
parent 1ccfe627a5
commit 02ee4898de
5 changed files with 16 additions and 35 deletions
+8 -9
View File
@@ -7,7 +7,7 @@ set -euo pipefail
# - Installs dependencies
# - Prompts for API credentials
# - Generates .env
# - Starts the bot
# - Prepares to start the bot (does not auto-run)
main() {
require_unix
@@ -19,9 +19,14 @@ main() {
prompt_env
write_env
echo
echo "✅ Setup complete. Starting ritmex-bot..."
# Ensure we end inside the project directory
cd "$PROJECT_DIR"
echo "✅ 安装完成!已进入项目目录:$PROJECT_DIR"
echo "请在终端中输入以下命令启动:"
echo
start_bot
echo " bun start"
echo
echo "提示:启动前可检查或编辑当前目录下的 .env 文件。"
}
require_unix() {
@@ -149,12 +154,6 @@ EOF
echo "✔ .env created at $(pwd)/${env_file}"
}
start_bot() {
# Bun auto-loads .env; no need to run dotenv explicitly
# Ensure Bun has a TTY for interactive menu input
exec bun index.ts < /dev/tty
}
main "$@"