|
62 | 62 | (b/copy-file {:src (str doc-dir "/clojure.1") :target (str tar-dir "/clj.1")}) |
63 | 63 | (b/copy-dir {:src-dirs [target-dir] :target-dir tar-dir :include "*.jar"}) |
64 | 64 | (b/process {:command-args ["tar" "-cvzf" tar-file "-Ctarget" "clojure-tools"]}) |
65 | | - (b/copy-file {:src (str filtered-dir "/clojure/install/linux-install.sh") :target (str target-dir "/linux-install.sh")}) |
66 | | - (b/copy-file {:src (str filtered-dir "/clojure/install/posix-install.sh") :target (str target-dir "/posix-install.sh")}) |
67 | 65 |
|
68 | 66 | ;; Collect the windows files and make the windows zip file and installer |
69 | 67 | (doseq [f ["ClojureTools.psd1" "ClojureTools.psm1" "deps.edn" "example-deps.edn" "tools.edn"]] |
|
72 | 70 | (b/zip {:src-dirs [zip-dir] :zip-file zip-file}) |
73 | 71 | (b/copy-file {:src (str filtered-dir "/clojure/install/win-install.ps1") :target (str target-dir "/win-install.ps1")}) |
74 | 72 |
|
75 | | - ;; Prep the brew files |
76 | | - (let [sha (-> (:out (b/process {:command-args ["shasum" "-a" "256" tar-file] :out :capture})) (subs 0 64)) |
77 | | - brew-recipe (slurp (str filtered-dir "/clojure/install/clojure.rb")) |
78 | | - version-recipe (slurp (str filtered-dir "/clojure/install/clojure@version.rb"))] |
79 | | - (b/write-file {:path "target/clojure.rb" :string (str/replace brew-recipe "SHA" sha)}) |
80 | | - (b/write-file {:path (format "target/clojure@%s.rb" version) :string (str/replace version-recipe "SHA" sha)}))) |
| 73 | + ;; Embed artifact checksums within installers |
| 74 | + (let [sha (-> (:out (b/process {:command-args ["shasum" "-a" "256" tar-file] :out :capture})) (subs 0 64))] |
| 75 | + (doseq [[src target] [["clojure/install/clojure.rb"] |
| 76 | + ["clojure/install/clojure@version.rb" (format "clojure@%s.rb" version)] |
| 77 | + ["clojure/install/linux-install.sh"] |
| 78 | + ["clojure/install/posix-install.sh"]] |
| 79 | + :let [target (str target-dir "/" (or target (peek (str/split src #"/")))) |
| 80 | + src (str filtered-dir "/" src)]] |
| 81 | + (b/write-file {:path target |
| 82 | + :string (str/replace (slurp src) "SHA" sha)})))) |
0 commit comments