Skip to content

Commit

Permalink
gen script
Browse files Browse the repository at this point in the history
  • Loading branch information
borkdude committed Dec 27, 2024
1 parent 0575f8d commit a81b2df
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions deps.bat
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ For more info, see:
(let [f (io/file p executable)]
(if (and (.isFile f)
(.canExecute f))
(.getCanonicalPath f)
(.getPath f)
(recur (rest paths)))))))))

(defn- home-dir []
Expand All @@ -288,7 +288,7 @@ For more info, see:
(let [f (io/file java-home "bin" java-exe)]
(if (and (.exists f)
(.canExecute f))
(.getCanonicalPath f)
(.getPath f)
(throw (Exception. "Couldn't find 'java'. Please set JAVA_HOME."))))
(throw (Exception. "Couldn't find 'java'. Please set JAVA_HOME."))))
java-cmd))))
Expand Down Expand Up @@ -525,7 +525,7 @@ public class ClojureToolsDownloader {
java-cmd [(get-java-cmd) "-XX:-OmitStackTraceInFastThrow"]
success?* (atom true)]
(binding [*exit-fn* (fn [{:keys [exit message]}]
(when-not (= exit 0)
(when-not (= 0 exit)
(warn message)
(reset! success?* false)))]
(*aux-process-fn* {:cmd (vec (concat java-cmd
Expand Down Expand Up @@ -594,7 +594,7 @@ public class ClojureToolsDownloader {
(*exit-fn* {:exit ct-error-exit-code
:message (str "Error: Cannot download Clojure tools."
" Please download manually from " ct-url-str
" to " (str (io/file dir ct-zip-name)))})
" to " (io/file dir ct-zip-name))})
::passthrough)]
(when (and sha256-url-str (not *clojure-tools-download-fn*) (not (.exists sha256-file)) (not= ::passthrough res))
(*exit-fn* {:exit ct-error-exit-code
Expand All @@ -614,7 +614,7 @@ public class ClojureToolsDownloader {
:message (str "Error: sha256 of zip and expected sha256 do not match: "
hash " vs. " sha "\n"
" Please download manually from " ct-url-str
" to " (str (io/file dir ct-zip-name)))})
" to " (io/file dir ct-zip-name))})
(.delete sha256-file))))
(warn "Unzipping" (str zip-file) "...")
(unzip zip-file (.getPath dir))
Expand Down Expand Up @@ -1129,7 +1129,7 @@ public class ClojureToolsDownloader {
main-cache-opts (when (.exists (io/file main-file))
(-> main-file slurp str/split-lines))
main-cache-opts (str/join " " main-cache-opts)
command (str/replace command "{{main-opts}}" (str main-cache-opts))
command (str/replace command "{{main-opts}}" main-cache-opts)
command (str/split command #"\s+")
command (into command (:args cli-opts))]
(*clojure-process-fn* {:cmd command}))
Expand Down
12 changes: 6 additions & 6 deletions deps.clj
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ For more info, see:
(let [f (io/file p executable)]
(if (and (.isFile f)
(.canExecute f))
(.getCanonicalPath f)
(.getPath f)
(recur (rest paths)))))))))

(defn- home-dir []
Expand All @@ -283,7 +283,7 @@ For more info, see:
(let [f (io/file java-home "bin" java-exe)]
(if (and (.exists f)
(.canExecute f))
(.getCanonicalPath f)
(.getPath f)
(throw (Exception. "Couldn't find 'java'. Please set JAVA_HOME."))))
(throw (Exception. "Couldn't find 'java'. Please set JAVA_HOME."))))
java-cmd))))
Expand Down Expand Up @@ -520,7 +520,7 @@ public class ClojureToolsDownloader {
java-cmd [(get-java-cmd) "-XX:-OmitStackTraceInFastThrow"]
success?* (atom true)]
(binding [*exit-fn* (fn [{:keys [exit message]}]
(when-not (= exit 0)
(when-not (= 0 exit)
(warn message)
(reset! success?* false)))]
(*aux-process-fn* {:cmd (vec (concat java-cmd
Expand Down Expand Up @@ -589,7 +589,7 @@ public class ClojureToolsDownloader {
(*exit-fn* {:exit ct-error-exit-code
:message (str "Error: Cannot download Clojure tools."
" Please download manually from " ct-url-str
" to " (str (io/file dir ct-zip-name)))})
" to " (io/file dir ct-zip-name))})
::passthrough)]
(when (and sha256-url-str (not *clojure-tools-download-fn*) (not (.exists sha256-file)) (not= ::passthrough res))
(*exit-fn* {:exit ct-error-exit-code
Expand All @@ -609,7 +609,7 @@ public class ClojureToolsDownloader {
:message (str "Error: sha256 of zip and expected sha256 do not match: "
hash " vs. " sha "\n"
" Please download manually from " ct-url-str
" to " (str (io/file dir ct-zip-name)))})
" to " (io/file dir ct-zip-name))})
(.delete sha256-file))))
(warn "Unzipping" (str zip-file) "...")
(unzip zip-file (.getPath dir))
Expand Down Expand Up @@ -1124,7 +1124,7 @@ public class ClojureToolsDownloader {
main-cache-opts (when (.exists (io/file main-file))
(-> main-file slurp str/split-lines))
main-cache-opts (str/join " " main-cache-opts)
command (str/replace command "{{main-opts}}" (str main-cache-opts))
command (str/replace command "{{main-opts}}" main-cache-opts)
command (str/split command #"\s+")
command (into command (:args cli-opts))]
(*clojure-process-fn* {:cmd command}))
Expand Down

0 comments on commit a81b2df

Please sign in to comment.