feat: 调整启用脚本

This commit is contained in:
李如威 2025-09-30 16:50:29 +08:00
parent 79183a73db
commit 3117bf518c
1 changed files with 11 additions and 1 deletions

View File

@ -1,7 +1,17 @@
#!/bin/bash #!/bin/bash
# ---- 加载 nvm ----
export NVM_DIR="$HOME/.nvm"
if [ -s "$NVM_DIR/nvm.sh" ]; then
\. "$NVM_DIR/nvm.sh" # 这是必须的
else
echo "Error: nvm.sh not found!"
exit 1
fi
# 切换 Node.js 版本 # 切换 Node.js 版本
nvm use v22.18.0 nvm use v22.18.0 || { echo "Failed to switch Node.js version"; exit 1; }
# 激活 Python 虚拟环境 # 激活 Python 虚拟环境
source backend/venv/bin/activate source backend/venv/bin/activate