diff --git a/src/compile_controllers/mod.rs b/src/compile_controllers/mod.rs index 1f40f84..2e3a8ae 100644 --- a/src/compile_controllers/mod.rs +++ b/src/compile_controllers/mod.rs @@ -27,6 +27,7 @@ impl CompileController { let optional_version = compile_matches.get_one::("version"); let optional_branch = compile_matches.get_one::("branch"); // We need to implement this + let our_optional_branch = optional_branch.map(|branch| branch.to_string()); // Check if Java is installed on the system if !is_java_installed() { @@ -43,7 +44,7 @@ impl CompileController { spigotmc::SpigotAPI::handle_spigot(&compile_dir, optional_version.unwrap(), &mut path_string); } else if software.eq_ignore_ascii_case("PlotSquared") { - plotsquared::PlotSquaredAPI::handle_plotsquared(&compile_dir, &mut path_string).await; + plotsquared::PlotSquaredAPI::handle_plotsquared(&compile_dir, &mut path_string, our_optional_branch).await; } else { println!("{}", format!("Unknown software: {}", software).red()); } diff --git a/src/compile_controllers/plotsquared/mod.rs b/src/compile_controllers/plotsquared/mod.rs index 717cc8e..e00e898 100644 --- a/src/compile_controllers/plotsquared/mod.rs +++ b/src/compile_controllers/plotsquared/mod.rs @@ -7,10 +7,10 @@ use std::path::PathBuf; pub(crate) struct PlotSquaredAPI; impl PlotSquaredAPI { - pub async fn handle_plotsquared(compile_path: &PathBuf, path: &mut String) { + pub async fn handle_plotsquared(compile_path: &PathBuf, path: &mut String, branch: Option) { let config = SoftwareConfig { repo_url: "https://github.com/IntellectualSites/PlotSquared.git".to_string(), - branch: None, + branch, build_command: "gradlew build".to_string(), jar_regex: r"plotsquared-.*\.jar".to_string(), jar_location: "Bukkit/build/libs/".to_string(),