Skip to content

Instantly share code, notes, and snippets.

@MrGung
Created June 20, 2022 18:14
Show Gist options
  • Save MrGung/4d08f6e9334dc3c970d92186f91400f3 to your computer and use it in GitHub Desktop.
Save MrGung/4d08f6e9334dc3c970d92186f91400f3 to your computer and use it in GitHub Desktop.

Instructions

  • Modify deps.edn to contain the dependencies you need.
  • Call bb zip <zipname> to create the ZIP-file, omitting the extension .zip.
{:tasks {:requires ([clojure.string :as str]
[babashka.fs :as fs])
:init (do
(def zipname (first *command-line-args*)))
zip {:depends [temp-file]
:task (shell (format "tar -cf %s.zip -T %s" zipname temp-file))}
temp-file {:depends [strip-src]
:task (let [fil (.toFile (fs/create-temp-file))]
(spit fil (str/join "\n" strip-src))
fil)}
strip-src {:depends [split-src]
:task (remove (fn [path] (= path "src")) split-src)}
split-src {:depends [deps]
:task (str/split deps (re-pattern ";"))}
deps {:depends []
:task (with-out-str (clojure "-Spath -Sdeps"))}}}
{:deps {thheller/shadow-cljs {:mvn/version "2.19.3"}}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment