Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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}
12 changes: 9 additions & 3 deletions src/bootstrap.clj
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,22 @@

(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)
(props/store-properties props {"BOOT_VERSION" version})))))

(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]
Expand Down