Skip to content

Commit

Permalink
Don't use /tmp when LEIN_FAST_TRAMPOLINE is enabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
technomancy committed Jan 21, 2014
1 parent 5726335 commit 19c49bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/lein
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ else
if ([ "$LEIN_FAST_TRAMPOLINE" != "" ] || [ -r .lein-fast-trampoline ]) &&
[ -r project.clj ]; then
INPUTS="$@ $(cat project.clj) $LEIN_VERSION $(test -f "$LEIN_HOME/profiles.clj" && cat "$LEIN_HOME/profiles.clj")"
INPUT_CHECKSUM=$(echo $INPUTS | shasum - | cut -f 1 -d " ")
export INPUT_CHECKSUM=$(echo $INPUTS | shasum - | cut -f 1 -d " ")
# Just don't change :target-path in project.clj, mkay?
TRAMPOLINE_FILE="target/trampolines/$INPUT_CHECKSUM"
else
Expand Down
4 changes: 3 additions & 1 deletion leiningen-core/src/leiningen/core/eval.clj
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,9 @@ leiningen.core.utils/platform-nullsink instead."
(defn shell-command
"Calculate vector of strings needed to evaluate form in a project subprocess."
[project form]
(let [init-file (File/createTempFile "form-init" ".clj")]
(let [init-file (if-let [checksum (System/getenv "INPUT_CHECKSUM")]
(io/file (:target-path project) (str checksum "-init.clj"))
(File/createTempFile "form-init" ".clj"))]
(if-not (System/getenv "LEIN_FAST_TRAMPOLINE")
(spit init-file (pr-str `(-> (java.io.File. ~(.getCanonicalPath init-file))
(.deleteOnExit)))))
Expand Down

0 comments on commit 19c49bd

Please sign in to comment.