Skip to content

Commit

Permalink
ok
Browse files Browse the repository at this point in the history
  • Loading branch information
markaren committed Oct 31, 2024
1 parent a03c213 commit afaa7c0
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/fmi4cpp/tools/unzipper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,15 @@ bool fmi4cpp::unzip(const std::filesystem::path& zip_file, const std::filesystem
}

#ifdef _WIN32
// Windows: Use the built-in unzip command via PowerShell
std::string command = "tar -xf \"" + relative(zip_file).string() + "\" -C \"" + tmp_path.string() + "\"";
// Windows: Use the built-in tar command
std::string command = "tar -xf \"" + zip_file.string() + "\" -C \"" + tmp_path.string() + "\"";
#else
// Linux: Use the unzip command
std::string command = "unzip -o \"" + zip_file.string() + "\" -d \"" + tmp_path.string() + "\" > /dev/null 2>&1";
#endif

MLOG_ERROR("Attempting unzip with command: " + command);

// Execute the command
int result = std::system(command.c_str());
const int result = std::system(command.c_str());

if (result != 0) {
MLOG_ERROR("Error: Unzipping failed with code " + result);
Expand Down

0 comments on commit afaa7c0

Please sign in to comment.