diff --git a/do_release.bat b/do_release.bat new file mode 100644 index 0000000..7d6a1eb --- /dev/null +++ b/do_release.bat @@ -0,0 +1,27 @@ +@echo off + +REM Comprobar parĂ¡metro +IF "%1"=="" ( + echo Uso: build_windows.bat ^ + exit /b 1 +) + +set PARAM=%1 + +echo Compilando windows... +make windows || exit /b 1 + +echo Compilando windows_debug... +make windows_debug || exit /b 1 + +echo Creando paquetes... + +REM Crear ZIP release con mini.exe + DLLs +tar -a -c -f mini_%PARAM%_windows_release.zip mini.exe bin\*.dll || exit /b 1 + +REM Crear ZIP debug solo con mini_debug.exe +tar -a -c -f mini_%PARAM%_windows_debug.zip mini_debug.exe || exit /b 1 + +echo Paquetes generados: +echo mini_%PARAM%_windows_release.zip +echo mini_%PARAM%_windows_debug.zip diff --git a/do_release.sh b/do_release.sh new file mode 100644 index 0000000..1f9e379 --- /dev/null +++ b/do_release.sh @@ -0,0 +1,36 @@ +#!/bin/bash +set -e + +if [ -z "$1" ]; then + echo "Uso: $0 " + exit 1 +fi + +PARAM=$1 + +# Datos Windows +WIN_USER="raimon" +WIN_HOST="192.168.1.51" +WIN_PATH_SSH="/cygdrive/c/Users/raimon/dev/mini" + +echo "=== Compilando Linux ===" +make linux +make linux_debug + +echo "=== Empaquetando Linux ===" +tar -czf mini_${PARAM}_linux_release.tar.gz mini +tar -czf mini_${PARAM}_linux_debug.tar.gz mini_debug + +echo "=== Ejecutando build remoto Windows ===" +ssh ${WIN_USER}@${WIN_HOST} "cd '${WIN_PATH_SSH}' && build_windows.bat ${PARAM}" + +echo "=== Copiando ZIPs desde Windows ===" +scp ${WIN_USER}@${WIN_HOST}:"${WIN_PATH_SSH}/mini_${PARAM}_windows_release.zip" . +scp ${WIN_USER}@${WIN_HOST}:"${WIN_PATH_SSH}/mini_${PARAM}_windows_debug.zip" . + +echo "=== Build completado correctamente ===" +echo "Generados:" +echo " mini_${PARAM}_linux_release.tar.gz" +echo " mini_${PARAM}_linux_debug.tar.gz" +echo " mini_${PARAM}_windows_release.zip" +echo " mini_${PARAM}_windows_debug.zip" diff --git a/jfile.cpp b/jfile.cpp index aa3f99e..b19c13f 100644 --- a/jfile.cpp +++ b/jfile.cpp @@ -78,10 +78,11 @@ bool file_getdictionary() { fi.read( (char*)&file_size, 4 ); uint8_t path_size; fi.read( (char*)&path_size, 1 ); - char file_name[path_size+1]; + char *file_name = (char*)malloc(path_size+1); fi.read( file_name, path_size ); file_name[path_size] = 0; std::string filename = file_name; + free(file_name); toc.push_back({filename, file_size, file_offset}); } fi.close();