From 2b12b26b14854784a39ff70ff6bf3a8107eada85 Mon Sep 17 00:00:00 2001 From: Paulo Cabral Sanz Date: Wed, 6 Nov 2024 17:50:26 -0300 Subject: [PATCH] Pick correct binary in newer versions of clojure --- src/providers/clojure.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/providers/clojure.rs b/src/providers/clojure.rs index a107fe746..96d7d33cc 100644 --- a/src/providers/clojure.rs +++ b/src/providers/clojure.rs @@ -43,11 +43,12 @@ impl Provider for ClojureProvider { }; // based on project config, uberjar can be created under ./target/uberjar or ./target, This ensure file will be found on the same place whatevery the project config is - let move_file_cmd = "if [ -f /app/target/default+uberjar/*standalone.jar ]; then mv /app/target/default+uberjar/*standalone.jar /app/target/*standalone.jar; fi"; + let move_file_cmd = "for name in /app/target/default+uberjar/*.jar; do case $name in (*SNAPSHOT*) continue;; esac; mv $name /app/target/standalone.jar; fi"; + let mut build = Phase::build(Some(format!("{build_cmd}; {move_file_cmd}"))); build.depends_on_phase("setup"); - let start = StartPhase::new("JAR_FILE=$(find ./target -name \"*standalone.jar\"); bash -c \"java $JAVA_OPTS -jar $JAR_FILE\""); + let start = StartPhase::new("JAR_FILE=$(find ./target -name \"standalone.jar\"); bash -c \"java $JAVA_OPTS -jar $JAR_FILE\""); let plan = BuildPlan::new(&vec![setup, build], Some(start)); Ok(Some(plan))