mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 21:01:29 +00:00
Tweaked compression arguments for 7-Zip cli command invocation
This commit is contained in:
parent
dac7541d89
commit
6a61fd5df9
@ -50,7 +50,11 @@ std::string DatabaseDumpService::execute(const std::string &cmd, bool return_res
|
|||||||
const char *file_name = "db-exec-result.txt";
|
const char *file_name = "db-exec-result.txt";
|
||||||
|
|
||||||
if (return_result) {
|
if (return_result) {
|
||||||
|
#ifdef _WINDOWS
|
||||||
|
std::system((cmd + " > " + file_name + " 2>&1").c_str());
|
||||||
|
#else
|
||||||
std::system((cmd + " > " + file_name).c_str());
|
std::system((cmd + " > " + file_name).c_str());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
std::system((cmd).c_str());
|
std::system((cmd).c_str());
|
||||||
@ -95,7 +99,7 @@ bool DatabaseDumpService::IsTarAvailable()
|
|||||||
*/
|
*/
|
||||||
bool DatabaseDumpService::Is7ZipAvailable()
|
bool DatabaseDumpService::Is7ZipAvailable()
|
||||||
{
|
{
|
||||||
std::string version_output = execute("7z -help");
|
std::string version_output = execute("7z --help");
|
||||||
|
|
||||||
return version_output.find("7-Zip") != std::string::npos;
|
return version_output.find("7-Zip") != std::string::npos;
|
||||||
}
|
}
|
||||||
@ -396,9 +400,8 @@ void DatabaseDumpService::Dump()
|
|||||||
else if (Is7ZipAvailable()) {
|
else if (Is7ZipAvailable()) {
|
||||||
execute(
|
execute(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"7z a -t7z {}.zip -C {} {}.sql",
|
"7z a -t7z {}.zip {}.sql",
|
||||||
GetDumpFileNameWithPath(),
|
GetDumpFileNameWithPath(),
|
||||||
GetSetDumpPath(),
|
|
||||||
GetDumpFileNameWithPath()
|
GetDumpFileNameWithPath()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user