diff --git a/src/babashka/main.clj b/src/babashka/main.clj index 268990c9..453b39e8 100644 --- a/src/babashka/main.clj +++ b/src/babashka/main.clj @@ -708,7 +708,8 @@ Use -- to separate script command line args from bb command line args. :preloads preloads :loader (:loader @cp/cp-state)})))) exec-fn (exec-fn) - exec-src [(sci/binding [sci/file (or @sci/file "")] + exec-src [(sci/binding [sci/file (or @sci/file "") + core/command-line-args command-line-args] (sci/eval-string* sci-ctx exec-src)) 0] clojure [nil (if-let [proc (deps/clojure command-line-args)] diff --git a/test-resources/bb-edn/user.clj b/test-resources/bb-edn/user.clj index 034e299f..00be0c99 100644 --- a/test-resources/bb-edn/user.clj +++ b/test-resources/bb-edn/user.clj @@ -3,7 +3,6 @@ [clojure.string :as str])) (defn bash [& args] - ;; (prn :args args) ;; (prn :cmd *command-line-args*) (-> (p/process ["bash" "-c" (str/join " " args)] {:inherit true}) diff --git a/test-resources/bb.edn b/test-resources/bb.edn index 2f06023f..d2f3b627 100644 --- a/test-resources/bb.edn +++ b/test-resources/bb.edn @@ -7,8 +7,8 @@ :args [-e (apply + (map (fn [i] (Integer/parseInt i)) *command-line-args*))]} - :tree {:task/type :babashka - :args [:clojure -Stree]} + :describe {:task/type :babashka + :args [:clojure -Sdescribe]} :do-bash {:task/type :babashka :args [:do :bash "ls | wc -l" :__ :eval-plus 1 2 3]} @@ -16,4 +16,4 @@ :args [:do :count-files :__ :bash "ls | wc -l" :__ :eval-plus 1 2 3 - :__ :tree]}}} + :__ :describe]}}}