Skip to content

Commit ae90fc9

Browse files
committed
add reading from unzipped/launch-args.txt on ios as an option
1 parent 9b8fb73 commit ae90fc9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

loader/src/platform/ios/LoaderImpl.mm

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include <Geode/loader/Dirs.hpp>
44
#include <Geode/loader/Loader.hpp>
55
#include <Geode/loader/Log.hpp>
6+
#include <Geode/utils/file.hpp>
67
#include <loader/ModImpl.hpp>
78
#include <loader/IPC.hpp>
89
#include <loader/console.hpp>
@@ -69,6 +70,15 @@
6970
}
7071

7172
std::string Loader::Impl::getLaunchCommand() const {
73+
auto launchArgsFile = dirs::getModRuntimeDir() / "launch-args.txt";
74+
if (std::filesystem::exists(launchArgsFile)) {
75+
log::debug("Reading launch arguments from {}", launchArgsFile.string());
76+
auto content = file::readString(launchArgsFile);
77+
if (content.isOk()) {
78+
return content.unwrap();
79+
}
80+
}
81+
7282
return (getenv("LAUNCHARGS")) ? getenv("LAUNCHARGS") : std::string();
7383
}
7484

0 commit comments

Comments
 (0)