Skip to content

Commit f699087

Browse files
Add optional plugin list output path parameter
1 parent 6d49055 commit f699087

3 files changed

Lines changed: 21 additions & 9 deletions

File tree

src/lootthread.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ void LOOTWorker::setGamePath(const std::string& gamePath)
8585
m_GamePath = gamePath;
8686
}
8787

88-
void LOOTWorker::setOutput(const std::string& outputPath)
88+
void LOOTWorker::setReportOutputPath(const std::string& reportOutputPath)
8989
{
90-
m_OutputPath = outputPath;
90+
m_ReportOutputPath = reportOutputPath;
9191
}
9292

9393
void LOOTWorker::setUpdateMasterlist(bool update)
@@ -100,6 +100,12 @@ void LOOTWorker::setPluginListPath(const std::string& pluginListPath)
100100
m_PluginListPath = pluginListPath;
101101
}
102102

103+
void LOOTWorker::setSortedPluginListOutputPath(
104+
const std::string& sortedPluginListOutputPath)
105+
{
106+
m_SortedPluginListOutputPath = sortedPluginListOutputPath;
107+
}
108+
103109
void LOOTWorker::setLanguageCode(const std::string& languageCode)
104110
{
105111
m_Language = languageCode;
@@ -818,10 +824,10 @@ int LOOTWorker::run()
818824

819825
progress(Progress::WritingLoadorder);
820826

821-
std::ofstream outf(m_PluginListPath);
827+
std::ofstream outf(m_SortedPluginListOutputPath);
822828
if (!outf) {
823829
log(loot::LogLevel::error,
824-
"failed to open " + m_PluginListPath + " to rewrite it");
830+
"failed to open " + m_SortedPluginListOutputPath + " to rewrite it");
825831
return 1;
826832
}
827833
outf << "# This file was automatically generated by Mod Organizer." << std::endl;
@@ -831,7 +837,7 @@ int LOOTWorker::run()
831837
outf.close();
832838

833839
progress(Progress::ParsingLootMessages);
834-
std::ofstream(m_OutputPath) << createJsonReport(*gameHandle, sortedPlugins);
840+
std::ofstream(m_ReportOutputPath) << createJsonReport(*gameHandle, sortedPlugins);
835841
} catch (std::system_error& e) {
836842
log(loot::LogLevel::error, e.what());
837843
return 1;

src/lootthread.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ class LOOTWorker
2323

2424
void setGame(const std::string& gameName);
2525
void setGamePath(const std::string& gamePath);
26-
void setOutput(const std::string& outputPath);
26+
void setReportOutputPath(const std::string& reportOutputPath);
2727
void setPluginListPath(const std::string& pluginListPath);
28+
void setSortedPluginListOutputPath(const std::string& sortedPluginListOutputPath);
2829
void
2930
setLanguageCode(const std::string& language_code); // Will add this when I figure out
3031
// how languages work on MO
@@ -73,8 +74,9 @@ class LOOTWorker
7374
std::string m_Language;
7475
std::string m_GameName;
7576
std::string m_GamePath;
76-
std::string m_OutputPath;
77+
std::string m_ReportOutputPath;
7778
std::string m_PluginListPath;
79+
std::string m_SortedPluginListOutputPath;
7880
loot::LogLevel m_LogLevel;
7981
bool m_UpdateMasterlist;
8082
mutable std::recursive_mutex mutex_;

src/main.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,12 @@ int wWinMain(HINSTANCE, HINSTANCE, LPTSTR, int)
7474
worker.setUpdateMasterlist(!getParameter<bool>(arguments, "skipUpdateMasterlist"));
7575
worker.setGame(getParameter<std::string>(arguments, "game"));
7676
worker.setGamePath(getParameter<std::string>(arguments, "gamePath"));
77-
worker.setPluginListPath(getParameter<std::string>(arguments, "pluginListPath"));
78-
worker.setOutput(getParameter<std::string>(arguments, "out"));
77+
78+
const auto pluginListPath = getParameter<std::string>(arguments, "pluginListPath");
79+
worker.setPluginListPath(pluginListPath);
80+
worker.setReportOutputPath(getParameter<std::string>(arguments, "out"));
81+
worker.setSortedPluginListOutputPath(getOptionalParameter<std::string>(
82+
arguments, "pluginListOutputPath", pluginListPath));
7983
worker.setLogLevel(getLogLevel(arguments));
8084

8185
const auto lang = getOptionalParameter<std::string>(arguments, "language", "");

0 commit comments

Comments
 (0)