Просмотр исходного кода

Update setup script to pull latest evals repo (#3200)

Shariq Riaz 8 месяцев назад
Родитель
Сommit
4ce3e64027
1 измененных файлов с 7 добавлено и 1 удалено
  1. 7 1
      evals/scripts/setup.sh

+ 7 - 1
evals/scripts/setup.sh

@@ -295,8 +295,9 @@ code --install-extension rust-lang.rust-analyzer &>/dev/null || exit 1
 code --install-extension rooveterinaryinc.roo-cline &>/dev/null || exit 1
 
 if [[ ! -d "../../evals" ]]; then
+  echo "🔗 Cloning evals repository..."
   if gh auth status &>/dev/null; then
-    read -p "🔗 Would you like to be able to share eval results? (Y/n): " fork_evals
+    read -p "🔗 Would you like to be able to share eval results (fork repository)? (Y/n): " fork_evals
 
     if [[ "$fork_evals" =~ ^[Yy]|^$ ]]; then
       gh repo fork cte/evals --clone ../../evals || exit 1
@@ -306,6 +307,11 @@ if [[ ! -d "../../evals" ]]; then
   else
     git clone https://github.com/cte/evals.git ../../evals || exit 1
   fi
+else
+  echo "🔄 Updating existing evals repository..."
+  # Run in a subshell to avoid changing the script's working directory
+  (cd ../../evals && git checkout main && git pull) || { echo "❌ Failed to update evals repository."; exit 1; }
+  echo "✅ Evals repository is up to date."
 fi
 
 if [[ ! -s .env ]]; then