diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9215a6b --- /dev/null +++ b/Makefile @@ -0,0 +1,18 @@ +BINARY_LOC := $(shell which boot || which boot.bak | sed "s/.bak//") + +echo: + echo ${BINARY_LOC} + +bin/boot.sh: + boot build standalone + cat src/head.sh target/bootstrap.uber.jar > bin/boot.sh + chmod +x bin/boot.sh + +install-boot-bin: bin/boot.sh + mv bin/boot.sh ${BINARY_LOC} + +backup-boot-bin: + mv ${BINARY_LOC} ${BINARY_LOC}.bak + +restore-boot-bin: + mv ${BINARY_LOC}.bak ${BINARY_LOC} diff --git a/src/bootstrap.clj b/src/bootstrap.clj index 4a34e62..2ad789a 100644 --- a/src/bootstrap.clj +++ b/src/bootstrap.clj @@ -55,7 +55,7 @@ (defn- pin-version [version] (let [props (io/file (conf/work-dir) "boot.properties")] - (when (and (.exists ^File (io/file (conf/work-dir) "boot.properties")) + (when (and (.exists ^File props) (not= version (:boot-version (conf/project)))) (println (format "Pinning BOOT_VERSION to %s..." version)) (-> (props/load-properties props) @@ -63,8 +63,14 @@ (defn- launch-version [version args] (let [jar (.getAbsolutePath ^File (version-jar version)) - command (:boot-java-command (conf/config) "java") - ^List args (into [command "-jar" jar] args)] + conf (conf/config) + command (:boot-java-command conf "java") + jvm-options (some-> (get conf :boot-jvm-options) vector) + ^List args (into [command] + (concat + jvm-options + ["-jar" jar] + args))] (.waitFor (.start (.inheritIO (ProcessBuilder. args)))))) (defn- print-version [config]