-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
47 lines (41 loc) · 1.22 KB
/
build.bat
File metadata and controls
47 lines (41 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
@echo off
REM build.bat - automatiza venv, instalación de dependencias e compilación (onedir)
setlocal enabledelayedexpansion
REM 1) Comprobar que Python está dispoñible
python --version >nul 2>&1
if ERRORLEVEL 1 (
echo ERROR: Python non está dispoñible no PATH. Instala Python ou engadeo ao PATH.
exit /b 1
)
REM 2) Crear virtualenv se non existe
if exist venv (
echo Virtual environment "venv" existe. Usando o existente.
) else (
echo Creando virtual environment...
python -m venv venv || (
echo ERROR: non se puido crear o virtualenv.
exit /b 1
)
)
REM 3) Activar o venv
call venv\Scripts\activate
if ERRORLEVEL 1 (
echo ERROR: non se puido activar o virtualenv.
exit /b 1
)
REM 4) Actualizar pip e instalar dependencias
python -m pip install -U pip setuptools wheel
python -m pip install -r requirements.txt
if ERRORLEVEL 1 (
echo ERROR: non se puideron instalar as dependencias. Revisa requirements.txt
exit /b 1
)
REM 5) Executar PyInstaller (onedir via build.spec)
echo Executando PyInstaller (build.spec)...
python -m PyInstaller --clean build.spec
if ERRORLEVEL 1 (
echo ERROR: PyInstaller fallou ao compilar.
exit /b 1
)
echo Compilación completada. Output en dist\OCRmyPDFPortable\
endlocal