#!/usr/bin/env python3
"""
Cursor açıldığında otomatik başlatılacak FTP watch script'i
"""

import os
import sys
import subprocess
from pathlib import Path

script_path = Path(__file__).parent / 'ftp-sync.py'

if script_path.exists():
    try:
        # Arka planda çalıştır
        if sys.platform == 'win32':
            # Windows
            subprocess.Popen(
                [sys.executable, str(script_path), 'watch'],
                creationflags=subprocess.CREATE_NO_WINDOW,
                stdout=subprocess.DEVNULL,
                stderr=subprocess.DEVNULL
            )
        else:
            # Linux/Mac
            subprocess.Popen(
                [sys.executable, str(script_path), 'watch'],
                stdout=subprocess.DEVNULL,
                stderr=subprocess.DEVNULL,
                start_new_session=True
            )
        
        print("✓ FTP watch başlatıldı")
    except Exception as e:
        print(f"✗ Hata: {e}")
else:
    print("✗ FTP sync script bulunamadı")


