Compare commits
2 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a98a0ad567 | ||
|
|
71004ef2b1 |
3 changed files with 17 additions and 4 deletions
3
deps.edn
3
deps.edn
|
|
@ -26,7 +26,8 @@
|
||||||
datascript/datascript {:mvn/version "1.0.1"}
|
datascript/datascript {:mvn/version "1.0.1"}
|
||||||
http-kit/http-kit {:mvn/version "2.5.0"}
|
http-kit/http-kit {:mvn/version "2.5.0"}
|
||||||
babashka/clojure-lanterna {:mvn/version "0.9.8-SNAPSHOT"}
|
babashka/clojure-lanterna {:mvn/version "0.9.8-SNAPSHOT"}
|
||||||
org.clojure/math.combinatorics {:mvn/version "0.1.6"}}
|
org.clojure/math.combinatorics {:mvn/version "0.1.6"}
|
||||||
|
mvxcvi/puget {:mvn/version "1.3.1"}}
|
||||||
:aliases {:main
|
:aliases {:main
|
||||||
{:main-opts ["-m" "babashka.main"]}
|
{:main-opts ["-m" "babashka.main"]}
|
||||||
:profile
|
:profile
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,8 @@
|
||||||
[cheshire "5.10.0"]
|
[cheshire "5.10.0"]
|
||||||
[nrepl/bencode "1.1.0"]
|
[nrepl/bencode "1.1.0"]
|
||||||
[borkdude/sci.impl.reflector "0.0.1-java11"]
|
[borkdude/sci.impl.reflector "0.0.1-java11"]
|
||||||
[org.clojure/math.combinatorics "0.1.6"]]
|
[org.clojure/math.combinatorics "0.1.6"]
|
||||||
|
[mvxcvi/puget "1.3.1"]]
|
||||||
:profiles {:feature/xml {:source-paths ["feature-xml"]
|
:profiles {:feature/xml {:source-paths ["feature-xml"]
|
||||||
:dependencies [[org.clojure/data.xml "0.2.0-alpha6"]]}
|
:dependencies [[org.clojure/data.xml "0.2.0-alpha6"]]}
|
||||||
:feature/yaml {:source-paths ["feature-yaml"]
|
:feature/yaml {:source-paths ["feature-yaml"]
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@
|
||||||
[clojure.java.io :as io]
|
[clojure.java.io :as io]
|
||||||
[clojure.string :as str]
|
[clojure.string :as str]
|
||||||
[hf.depstar.uberjar :as uberjar]
|
[hf.depstar.uberjar :as uberjar]
|
||||||
|
[puget.printer :as puget]
|
||||||
[sci.addons :as addons]
|
[sci.addons :as addons]
|
||||||
[sci.core :as sci]
|
[sci.core :as sci]
|
||||||
[sci.impl.namespaces :as sci-namespaces]
|
[sci.impl.namespaces :as sci-namespaces]
|
||||||
|
|
@ -204,6 +205,16 @@
|
||||||
(let [options (next options)]
|
(let [options (next options)]
|
||||||
(recur (next options)
|
(recur (next options)
|
||||||
(assoc opts-map :main (first options))))
|
(assoc opts-map :main (first options))))
|
||||||
|
"--puget"
|
||||||
|
(let [options (next options)
|
||||||
|
opt (first options)
|
||||||
|
opt (when (and opt (not (str/starts-with? opt "-")))
|
||||||
|
opt)
|
||||||
|
options (if opt (next options)
|
||||||
|
options)]
|
||||||
|
(recur options
|
||||||
|
(assoc opts-map
|
||||||
|
:puget (or opt true))))
|
||||||
(if (some opts-map [:file :jar :socket-repl :expressions :main])
|
(if (some opts-map [:file :jar :socket-repl :expressions :main])
|
||||||
(assoc opts-map
|
(assoc opts-map
|
||||||
:command-line-args options)
|
:command-line-args options)
|
||||||
|
|
@ -474,7 +485,7 @@ If neither -e, -f, or --socket-repl are specified, then the first argument that
|
||||||
:repl :socket-repl :nrepl
|
:repl :socket-repl :nrepl
|
||||||
:verbose? :classpath
|
:verbose? :classpath
|
||||||
:main :uberscript :describe?
|
:main :uberscript :describe?
|
||||||
:jar :uberjar] :as _opts}
|
:jar :uberjar] :as cmd-line-opts}
|
||||||
(parse-opts args)
|
(parse-opts args)
|
||||||
_ (do ;; set properties
|
_ (do ;; set properties
|
||||||
(when main (System/setProperty "babashka.main" main))
|
(when main (System/setProperty "babashka.main" main))
|
||||||
|
|
@ -614,7 +625,7 @@ If neither -e, -f, or --socket-repl are specified, then the first argument that
|
||||||
:while (not (pipe-signal-received?))]
|
:while (not (pipe-signal-received?))]
|
||||||
(pr-f l))
|
(pr-f l))
|
||||||
(pr-f res))
|
(pr-f res))
|
||||||
(prn res)))) 0]]
|
((if (:puget cmd-line-opts) puget/cprint prn) res)))) 0]]
|
||||||
(if stream?
|
(if stream?
|
||||||
(recur)
|
(recur)
|
||||||
res)))))
|
res)))))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue