Fix CRLF line endings for Windows batch files

This commit is contained in:
Lizandro Guarnizo
2026-06-17 13:40:14 -05:00
parent 397a88e5a4
commit f2564db6ee
3 changed files with 100 additions and 100 deletions
+29 -29
View File
@@ -1,29 +1,29 @@
@echo off
chcp 65001 >nul
title RIPS Manager - Auto Update
:: ---- 1. Verificar Python ----
where python >nul 2>&1
if %errorlevel% neq 0 (
echo Descargando Python 3.12...
powershell -Command "& {Invoke-WebRequest -Uri 'https://www.python.org/ftp/python/3.12.9/python-3.12.9-amd64.exe' -OutFile '%TEMP%\python-installer.exe'}"
echo Instalando Python (esperar 1-2 min)...
start /wait "" "%TEMP%\python-installer.exe" /quiet InstallAllUsers=0 PrependPath=1 Include_test=0
echo Python instalado. Cerra y abri PowerShell de nuevo.
pause
exit /b
)
:: ---- 2. Actualizar e instalar deps ----
echo Pull inicial...
git pull
python -m pip install -q -r requirements.txt
:: ---- 3. Arrancar ----
echo.
echo ==========================================
echo Servidor: http://localhost:8080
echo Auto-update cada 60 segundos
echo Cerra esta ventana para detener
echo ==========================================
python auto_update.py
@echo off
chcp 65001 >nul
title RIPS Manager - Auto Update
:: ---- 1. Verificar Python ----
where python >nul 2>&1
if %errorlevel% neq 0 (
echo Descargando Python 3.12...
powershell -Command "& {Invoke-WebRequest -Uri 'https://www.python.org/ftp/python/3.12.9/python-3.12.9-amd64.exe' -OutFile '%TEMP%\python-installer.exe'}"
echo Instalando Python (esperar 1-2 min)...
start /wait "" "%TEMP%\python-installer.exe" /quiet InstallAllUsers=0 PrependPath=1 Include_test=0
echo Python instalado. Cerra y abri PowerShell de nuevo.
pause
exit /b
)
:: ---- 2. Actualizar e instalar deps ----
echo Pull inicial...
git pull
python -m pip install -q -r requirements.txt
:: ---- 3. Arrancar ----
echo.
echo ==========================================
echo Servidor: http://localhost:8080
echo Auto-update cada 60 segundos
echo Cerra esta ventana para detener
echo ==========================================
python auto_update.py
+23 -23
View File
@@ -1,23 +1,23 @@
import subprocess, threading, time, sys, os
from pathlib import Path
root = Path(__file__).parent.resolve()
def pull_loop():
while True:
time.sleep(60)
try:
r = subprocess.run(['git', 'pull'], cwd=root, capture_output=True, text=True, timeout=30)
if r.stdout.strip():
print(f"[auto] git pull: {r.stdout.strip()}")
subprocess.run([sys.executable, '-m', 'pip', 'install', '-q', '-r', 'requirements.txt'],
cwd=root, capture_output=True, timeout=30)
except Exception as e:
print(f"[auto] pull error: {e}")
threading.Thread(target=pull_loop, daemon=True).start()
os.chdir(root)
sys.path.insert(0, str(root))
import uvicorn, main
uvicorn.run('main:app', host='0.0.0.0', port=8080, reload=True)
import subprocess, threading, time, sys, os
from pathlib import Path
root = Path(__file__).parent.resolve()
def pull_loop():
while True:
time.sleep(60)
try:
r = subprocess.run(['git', 'pull'], cwd=root, capture_output=True, text=True, timeout=30)
if r.stdout.strip():
print(f"[auto] git pull: {r.stdout.strip()}")
subprocess.run([sys.executable, '-m', 'pip', 'install', '-q', '-r', 'requirements.txt'],
cwd=root, capture_output=True, timeout=30)
except Exception as e:
print(f"[auto] pull error: {e}")
threading.Thread(target=pull_loop, daemon=True).start()
os.chdir(root)
sys.path.insert(0, str(root))
import uvicorn, main
uvicorn.run('main:app', host='0.0.0.0', port=8080, reload=True)
+48 -48
View File
@@ -1,48 +1,48 @@
@echo off
chcp 65001 >nul
title RIPS Manager - Iniciando...
:: Verificar si ya existe Python portable
if exist python\python.exe goto :start
echo ==========================================
echo Descargando Python portable...
echo ==========================================
echo.
:: Descargar Python embeddable (64-bit)
powershell -Command "& {Invoke-WebRequest -Uri 'https://www.python.org/ftp/python/3.12.9/python-3.12.9-embed-amd64.zip' -OutFile 'python.zip'}"
if not exist python.zip (
echo ERROR: No se pudo descargar Python
pause
exit /b
)
echo.
echo Extrayendo...
powershell -Command "& {Expand-Archive -Path 'python.zip' -DestinationPath 'python' -Force}"
del python.zip
:: Habilitar pip (descomentar línea en el archivo de configuración)
set PYTHON_EXE=%~dp0python\python.exe
set PTH_FILE=%~dp0python\python312._pth
powershell -Command "& {(Get-Content '%PTH_FILE%') -replace '#import site','import site' | Set-Content '%PTH_FILE%'}"
:: Instalar pip
echo.
echo Instalando pip...
%PYTHON_EXE% -c "import urllib.request; exec(urllib.request.urlopen('https://bootstrap.pypa.io/get-pip.py').read())"
:start
echo.
echo Instalando dependencias...
python\python.exe -m pip install -q -r requirements.txt 2>nul
echo.
echo ==========================================
echo Servidor iniciado en http://localhost:8080
echo Presiona Ctrl+C para detener
echo ==========================================
python\python.exe main.py
pause
@echo off
chcp 65001 >nul
title RIPS Manager - Iniciando...
:: Verificar si ya existe Python portable
if exist python\python.exe goto :start
echo ==========================================
echo Descargando Python portable...
echo ==========================================
echo.
:: Descargar Python embeddable (64-bit)
powershell -Command "& {Invoke-WebRequest -Uri 'https://www.python.org/ftp/python/3.12.9/python-3.12.9-embed-amd64.zip' -OutFile 'python.zip'}"
if not exist python.zip (
echo ERROR: No se pudo descargar Python
pause
exit /b
)
echo.
echo Extrayendo...
powershell -Command "& {Expand-Archive -Path 'python.zip' -DestinationPath 'python' -Force}"
del python.zip
:: Habilitar pip (descomentar línea en el archivo de configuración)
set PYTHON_EXE=%~dp0python\python.exe
set PTH_FILE=%~dp0python\python312._pth
powershell -Command "& {(Get-Content '%PTH_FILE%') -replace '#import site','import site' | Set-Content '%PTH_FILE%'}"
:: Instalar pip
echo.
echo Instalando pip...
%PYTHON_EXE% -c "import urllib.request; exec(urllib.request.urlopen('https://bootstrap.pypa.io/get-pip.py').read())"
:start
echo.
echo Instalando dependencias...
python\python.exe -m pip install -q -r requirements.txt 2>nul
echo.
echo ==========================================
echo Servidor iniciado en http://localhost:8080
echo Presiona Ctrl+C para detener
echo ==========================================
python\python.exe main.py
pause