diff options
author | Petr Mrázek <peterix@gmail.com> | 2017-05-29 01:36:01 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2017-05-29 01:36:01 +0200 |
commit | 7acf1998eb0683860dc21fc740f1e6bd42f54169 (patch) | |
tree | 87bdc802879a14ca0ddd2c1abb6d7405efe1ab23 /api/logic/minecraft | |
parent | 50b8412a2690e8b2cbbbbc5c8481e45df084603d (diff) | |
download | MultiMC-7acf1998eb0683860dc21fc740f1e6bd42f54169.tar MultiMC-7acf1998eb0683860dc21fc740f1e6bd42f54169.tar.gz MultiMC-7acf1998eb0683860dc21fc740f1e6bd42f54169.tar.lz MultiMC-7acf1998eb0683860dc21fc740f1e6bd42f54169.tar.xz MultiMC-7acf1998eb0683860dc21fc740f1e6bd42f54169.zip |
NOISSUE split wrapper commands into command and args
This lets you use commands with parameters.
Diffstat (limited to 'api/logic/minecraft')
-rw-r--r-- | api/logic/minecraft/launch/DirectJavaLaunch.cpp | 11 | ||||
-rw-r--r-- | api/logic/minecraft/launch/LauncherPartLaunch.cpp | 11 |
2 files changed, 14 insertions, 8 deletions
diff --git a/api/logic/minecraft/launch/DirectJavaLaunch.cpp b/api/logic/minecraft/launch/DirectJavaLaunch.cpp index d82d9ff2..07dbb86c 100644 --- a/api/logic/minecraft/launch/DirectJavaLaunch.cpp +++ b/api/logic/minecraft/launch/DirectJavaLaunch.cpp @@ -17,6 +17,7 @@ #include <launch/LaunchTask.h> #include <minecraft/MinecraftInstance.h> #include <FileSystem.h> +#include <Commandline.h> #include <QStandardPaths> DirectJavaLaunch::DirectJavaLaunch(LaunchTask *parent) : LaunchStep(parent) @@ -57,9 +58,11 @@ void DirectJavaLaunch::executeTask() auto mcArgs = minecraftInstance->processMinecraftArgs(m_session); args.append(mcArgs); - QString wrapperCommand = instance->getWrapperCommand(); - if(!wrapperCommand.isEmpty()) + QString wrapperCommandStr = instance->getWrapperCommand().trimmed(); + if(!wrapperCommandStr.isEmpty()) { + auto wrapperArgs = Commandline::splitArgs(wrapperCommandStr); + auto wrapperCommand = wrapperArgs.takeFirst(); auto realWrapperCommand = QStandardPaths::findExecutable(wrapperCommand); if (realWrapperCommand.isEmpty()) { @@ -68,9 +71,9 @@ void DirectJavaLaunch::executeTask() emitFailed(reason); return; } - emit logLine("Wrapper command is:\n" + wrapperCommand + "\n\n", MessageLevel::MultiMC); + emit logLine("Wrapper command is:\n" + wrapperCommandStr + "\n\n", MessageLevel::MultiMC); args.prepend(javaPath); - m_process.start(wrapperCommand, args); + m_process.start(wrapperCommand, wrapperArgs + args); } else { diff --git a/api/logic/minecraft/launch/LauncherPartLaunch.cpp b/api/logic/minecraft/launch/LauncherPartLaunch.cpp index d9441e56..b641968c 100644 --- a/api/logic/minecraft/launch/LauncherPartLaunch.cpp +++ b/api/logic/minecraft/launch/LauncherPartLaunch.cpp @@ -18,6 +18,7 @@ #include <launch/LaunchTask.h> #include <minecraft/MinecraftInstance.h> #include <FileSystem.h> +#include <Commandline.h> #include <QStandardPaths> #include "Env.h" @@ -46,9 +47,11 @@ void LauncherPartLaunch::executeTask() args << "-jar" << FS::PathCombine(ENV.getJarsPath(), "NewLaunch.jar"); - QString wrapperCommand = instance->getWrapperCommand(); - if(!wrapperCommand.isEmpty()) + QString wrapperCommandStr = instance->getWrapperCommand().trimmed(); + if(!wrapperCommandStr.isEmpty()) { + auto wrapperArgs = Commandline::splitArgs(wrapperCommandStr); + auto wrapperCommand = wrapperArgs.takeFirst(); auto realWrapperCommand = QStandardPaths::findExecutable(wrapperCommand); if (realWrapperCommand.isEmpty()) { @@ -57,9 +60,9 @@ void LauncherPartLaunch::executeTask() emitFailed(reason); return; } - emit logLine("Wrapper command is:\n" + wrapperCommand + "\n\n", MessageLevel::MultiMC); + emit logLine("Wrapper command is:\n" + wrapperCommandStr + "\n\n", MessageLevel::MultiMC); args.prepend(javaPath); - m_process.start(wrapperCommand, args); + m_process.start(wrapperCommand, wrapperArgs + args); } else { |