#!/bin/bash
echo "🔄 還原小綠技能中..."
TARGET="/Users/lingochen/.openclaw/workspace/skills"

if [ -d "$TARGET/.git" ];
then
  echo "📁 skills 目錄已存在，更新中..."
  cd "$TARGET"
  git pull origin main 2>&1
else
  echo "📥 首次安裝，clone 中..."
  git clone https://github.com/Lingo1516/lingo-skills.git "$TARGET"
fi

echo "📦 安裝 Python 依賴..."
pip3 install -r "$TARGET/requirements.txt" 2>&1 | tail -3

echo ""
echo "✅ 完成！技能已還原。"
echo "按任意鍵關閉..."
read -n 1 -s
