From 40e7b739e9591397e4723479427a4b39bedba6aa Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Wed, 17 Mar 2021 14:08:08 +0100 Subject: [PATCH] wip [skip ci] --- src/babashka/main.clj | 7 ++++--- test-resources/bb-edn/user.clj | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/babashka/main.clj b/src/babashka/main.clj index fc744eb7..28e7263b 100644 --- a/src/babashka/main.clj +++ b/src/babashka/main.clj @@ -372,7 +372,7 @@ Use -- to separate script command line args from bb command line args. (case opt ("--") (assoc opts-map :command-line-args (next options)) ("--clojure" ":clojure") (assoc opts-map :clojure true - :opts (rest options)) + :command-line-args (rest options)) ("--version" ":version") {:version true} ("--help" "-h" "-?") {:help? true} ("--verbose")(recur (next options) @@ -513,7 +513,8 @@ Use -- to separate script command line args from bb command line args. (let [cmd-line-args (get task :args)] (parse-opts (seq (map str (concat cmd-line-args command-line-args))))) :shell - (let [args (get task :args)] + (let [args (get task :args) + args (into (vec args) command-line-args)] {:exec (fn [] [nil (-> (p/process args {:inherit true}) @@ -715,7 +716,7 @@ Use -- to separate script command line args from bb command line args. exec-src [(sci/binding [sci/file (or @sci/file "")] (sci/eval-string* sci-ctx exec-src)) 0] - clojure [nil (if-let [proc (deps/clojure (:opts opts))] + clojure [nil (if-let [proc (deps/clojure command-line-args)] (-> @proc :exit) 0)] uberscript [nil 0] diff --git a/test-resources/bb-edn/user.clj b/test-resources/bb-edn/user.clj index 0dbcb30a..126760a1 100644 --- a/test-resources/bb-edn/user.clj +++ b/test-resources/bb-edn/user.clj @@ -3,6 +3,8 @@ [clojure.string :as str])) (defn bash [& args] + (prn :args args) + (prn :cmd *command-line-args*) (-> (p/process ["bash" "-c" (str/join " " args)] {:inherit true}) p/check))