Skip to content

Commit

Permalink
Add --branch for PlotSquared
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew121410 committed Aug 29, 2024
1 parent d7d6cb5 commit d29da3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/compile_controllers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ impl CompileController {

let optional_version = compile_matches.get_one::<String>("version");
let optional_branch = compile_matches.get_one::<String>("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() {
Expand All @@ -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());
}
Expand Down
4 changes: 2 additions & 2 deletions src/compile_controllers/plotsquared/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>) {
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(),
Expand Down

0 comments on commit d29da3b

Please sign in to comment.