mirror of
https://github.com/open-goal/jak-project
synced 2026-08-21 23:00:45 -04:00
add project path option to the compiler (#1826)
This commit is contained in:
+15
-3
@@ -30,6 +30,7 @@ int main(int argc, char** argv) {
|
||||
std::string username = "#f";
|
||||
std::string game = "jak1";
|
||||
int nrepl_port = 8181;
|
||||
fs::path project_path_override;
|
||||
|
||||
CLI::App app{"OpenGOAL Compiler / REPL"};
|
||||
app.add_option("-c,--cmd", cmd, "Specify a command to run");
|
||||
@@ -45,15 +46,26 @@ int main(int argc, char** argv) {
|
||||
app.add_flag("--user-auto", auto_find_user,
|
||||
"Attempt to automatically deduce the user, overrides '-user'");
|
||||
app.add_option("-g,--game", game, "The game name: 'jak1' or 'jak2'");
|
||||
app.add_option("--proj-path", project_path_override,
|
||||
"Specify the location of the 'data/' folder");
|
||||
app.validate_positionals();
|
||||
CLI11_PARSE(app, argc, argv);
|
||||
|
||||
if (!file_util::setup_project_path(std::nullopt)) {
|
||||
GameVersion game_version = game_name_to_version(game);
|
||||
|
||||
if (!project_path_override.empty()) {
|
||||
if (!fs::exists(project_path_override)) {
|
||||
lg::error("Error: project path override '{}' does not exist", project_path_override.string());
|
||||
return 1;
|
||||
}
|
||||
if (!file_util::setup_project_path(project_path_override)) {
|
||||
lg::error("Could not setup project path!");
|
||||
return 1;
|
||||
}
|
||||
} else if (!file_util::setup_project_path(std::nullopt)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
GameVersion game_version = game_name_to_version(game);
|
||||
|
||||
if (auto_find_user) {
|
||||
username = "#f";
|
||||
std::regex allowed_chars("[0-9a-zA-Z\\-\\.\\!\\?<>]");
|
||||
|
||||
Reference in New Issue
Block a user