From bdf87875ec9e064ce365c2666f784c55addf28d5 Mon Sep 17 00:00:00 2001 From: Guilaume S Date: Tue, 26 Sep 2023 18:41:30 +0200 Subject: [PATCH 1/2] Fix file creation for unpacker Fix lib linking for packer cmake --- cmake/Packer.cmake | 2 +- sources/unpack/UnPackFile.cpp | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/Packer.cmake b/cmake/Packer.cmake index ba30fbb..37a0d6f 100644 --- a/cmake/Packer.cmake +++ b/cmake/Packer.cmake @@ -61,7 +61,7 @@ endif() ## STATIC LIBRARY LINKING ## <=====================================> -if (${STATIC_LIB_NAME}) +if (NOT ${STATIC_LIB_NAME} STREQUAL "") target_link_libraries(${EXEC} PUBLIC ${STATIC_LIB_NAME} diff --git a/sources/unpack/UnPackFile.cpp b/sources/unpack/UnPackFile.cpp index f88d518..48a96e3 100644 --- a/sources/unpack/UnPackFile.cpp +++ b/sources/unpack/UnPackFile.cpp @@ -5,6 +5,7 @@ #include #include +#include #include "UnPackFile.hpp" #include "File.hpp" @@ -74,6 +75,7 @@ void sw::UnPackFile::createFile(sw::chunkHeader &chunkHeader, std::string path, if (!outFile.is_open()) throw sw::FileException("File cannot be created"); outFile.write((char *)buffer, chunkHeader.sizeBase); + outFile.close(); free(buffer); } catch (const sw::FileException& e) { sw::Log::AddLog("Cannot create file: " + path, sw::Log::WARNING); From 3aa7c1933725043ac761a9486821d23e6c3970c1 Mon Sep 17 00:00:00 2001 From: Guilaume S Date: Tue, 26 Sep 2023 18:54:35 +0200 Subject: [PATCH 2/2] Update version name --- .github/workflows/Test_windows.yml | 2 +- CMakeLists.txt | 2 +- README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Test_windows.yml b/.github/workflows/Test_windows.yml index d95178a..ee477fd 100644 --- a/.github/workflows/Test_windows.yml +++ b/.github/workflows/Test_windows.yml @@ -12,7 +12,7 @@ on: env: BUILD_TYPE: Release - VERSION_NAME: 1.1 + VERSION_NAME: 1.2 jobs: Build_exec: diff --git a/CMakeLists.txt b/CMakeLists.txt index 2b745e5..157d7b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,7 +10,7 @@ set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/out/ ) project( "SW Packer" VERSION - 1.1 + 1.2 DESCRIPTION "Pack all resources into one file" LANGUAGES diff --git a/README.md b/README.md index 6e7d298..7f3b5ed 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ The compilation is simple, you can choose between two target: Packer and Unpacke ```shell mkdir "build" && cd build cmake -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=[Debug/Release] .. -cmake --build . --target SWEngine-[packer/unpacker]_1.1 --config [Debug/Release] +cmake --build . --target SWEngine-[packer/unpacker]_1.2 --config [Debug/Release] ``` #### Option You can define an option by using : `-D[option]=[value]`