-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_executable.sh
More file actions
48 lines (41 loc) · 1.36 KB
/
build_executable.sh
File metadata and controls
48 lines (41 loc) · 1.36 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
48
#!/bin/bash
# Script para empaquetar la aplicación Flask en un ejecutable
set -e
echo "🔨 Empaquetando aplicación Flask en ejecutable..."
echo ""
# Verificar que PyInstaller está instalado
if ! command -v pyinstaller &> /dev/null; then
echo "❌ PyInstaller no está instalado."
echo " Instálalo con: pip install pyinstaller"
exit 1
fi
# Verificar que las dependencias están instaladas
if ! python3 -c "import flask" 2>/dev/null; then
echo "❌ Flask no está instalado."
echo " Instala las dependencias con: pip install -r requirements.txt"
exit 1
fi
# Limpiar builds anteriores
echo "🧹 Limpiando builds anteriores..."
rm -rf build/ dist/ __pycache__/
find . -type d -name "__pycache__" -exec rm -r {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete 2>/dev/null || true
# Crear el ejecutable
echo "📦 Creando ejecutable con PyInstaller..."
pyinstaller build_app.spec
# Verificar que el ejecutable se creó
if [ -f "dist/DJ_CUCHI_app" ]; then
echo ""
echo "✅ ¡Ejecutable creado exitosamente!"
echo ""
echo "📁 Ubicación: $(pwd)/dist/DJ_CUCHI_app"
echo ""
echo "🚀 Para ejecutar:"
echo " ./dist/DJ_CUCHI_app"
echo ""
echo "💡 El ejecutable abrirá automáticamente el navegador en http://127.0.0.1:5000"
echo ""
else
echo "❌ Error: No se pudo crear el ejecutable"
exit 1
fi