Last active
March 1, 2019 11:35
-
-
Save gfredericks/900183dae706aae6361110b2383c8639 to your computer and use it in GitHub Desktop.
Self-contained clojure file with deps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#! top-of-file comments can be written using more #! lines, which | |
#! is a valid comment in both clojure and bash | |
":";# alternately this works too | |
#! The construction below uses cross-language syntactic hackery to | |
#! specify the -Sdeps arg in a part of the file that's interpreted | |
#! by clojure as clojure syntax (i.e., not a line comment), so it | |
#! should get syntax highlighting and other editor support | |
":"; DEPS=\ | |
'{:deps | |
{org.apache.commons/commons-compress {:mvn/version "1.17"}}}' | |
":"; exec clojure -Sdeps "$DEPS" "$0" "$@" | |
(ns frobnicate | |
(:import | |
(org.apache.commons.compress.archivers ArchiveStreamFactory) | |
(org.apache.commons.compress.archivers.tar TarArchiveEntry))) | |
;; put useful code here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
it seems github decides to highlight this as a bash file