diff --git a/src/babashka/main.clj b/src/babashka/main.clj index fbc1c75d..5973a71d 100644 --- a/src/babashka/main.clj +++ b/src/babashka/main.clj @@ -587,7 +587,11 @@ Use -- to separate script command line args from bb command line args. (let [cmd-line-args args] (parse-opts (seq (map str (concat cmd-line-args command-line-args))))) :shell - (let [args (into (vec args) command-line-args)] + (let [args (if (and (= 1 (count args)) + (string? (first args))) + (p/tokenize (first args)) + args) + args (into (vec args) command-line-args)] {:exec (fn [] [nil (-> (p/process args {:inherit true}) diff --git a/test/babashka/bb_edn_test.clj b/test/babashka/bb_edn_test.clj index 416edc08..4419df27 100644 --- a/test/babashka/bb_edn_test.clj +++ b/test/babashka/bb_edn_test.clj @@ -42,7 +42,14 @@ (with-config {:tasks {:clean [:shell "rm" (str temp-file)]}} (is (fs/exists? temp-file)) (bb :clean) - (is (not (fs/exists? temp-file)))))) + (is (not (fs/exists? temp-file))))) + (let [temp-dir (fs/create-temp-dir) + temp-file (fs/create-file (fs/path temp-dir "temp-file.txt"))] + (testing "tokenization" + (with-config {:tasks {:clean [:shell (str "rm " (str temp-file))]}} + (is (fs/exists? temp-file)) + (bb :clean) + (is (not (fs/exists? temp-file))))))) (deftest sequential-task-test (testing ":and-do"