wip [skip ci]
This commit is contained in:
parent
1160f44d22
commit
6515ef771a
1 changed files with 9 additions and 7 deletions
|
|
@ -476,10 +476,10 @@ Use -- to separate script command line args from bb command line args.
|
||||||
{:do parsed})
|
{:do parsed})
|
||||||
(":invoke")
|
(":invoke")
|
||||||
{:exec-src
|
{:exec-src
|
||||||
(pr-str `(do (if-let [f (requiring-resolve (symbol (first *command-line-args*)))]
|
(pr-str '(if-let [f (requiring-resolve (symbol (first *command-line-args*)))]
|
||||||
(apply f (rest *command-line-args*))
|
(apply f (rest *command-line-args*))
|
||||||
(throw (Exception. (str "Var not found: " (first *command-line-args*)
|
(throw (Exception. (str "Var not found: " (first *command-line-args*)
|
||||||
" " (babashka.classpath/get-classpath)))))))
|
" " (babashka.classpath/get-classpath))))))
|
||||||
:command-line-args (next options)}
|
:command-line-args (next options)}
|
||||||
;; fallback
|
;; fallback
|
||||||
(if (some opts-map [:file :jar :socket-repl :expressions :main])
|
(if (some opts-map [:file :jar :socket-repl :expressions :main])
|
||||||
|
|
@ -707,9 +707,11 @@ Use -- to separate script command line args from bb command line args.
|
||||||
:preloads preloads
|
:preloads preloads
|
||||||
:loader (:loader @cp/cp-state)}))))
|
:loader (:loader @cp/cp-state)}))))
|
||||||
exec-fn (exec-fn)
|
exec-fn (exec-fn)
|
||||||
exec-src [(sci/binding [sci/file (or @sci/file "<task>")
|
exec-src [(let [res (sci/binding [sci/file (or @sci/file "<task>")
|
||||||
core/command-line-args command-line-args]
|
core/command-line-args command-line-args]
|
||||||
(sci/eval-string* sci-ctx exec-src))
|
(sci/eval-string* sci-ctx exec-src))]
|
||||||
|
(when (some? res)
|
||||||
|
(prn res)))
|
||||||
0]
|
0]
|
||||||
clojure [nil (if-let [proc (deps/clojure command-line-args)]
|
clojure [nil (if-let [proc (deps/clojure command-line-args)]
|
||||||
(-> @proc :exit)
|
(-> @proc :exit)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue