#!/bin/bash
python3 envdev.py

if command -v lsof &> /dev/null; then
    # Linux (Bash)
    kill -9 $(lsof -i:3000 -t) 2> /dev/null
else
    # Windows (Git Bash)
    PID=$(netstat -ano | grep ":3000" | awk '{print $5}' | head -1)
    [ -n "$PID" ] && taskkill //F //PID $PID 2> /dev/null
fi

npm run dev
