From 3f49ad3b89afeaa200bb6dd3fa71424ab05edce0 Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Sat, 5 Mar 2022 17:11:11 +0100 Subject: [PATCH] fix #1199: print-method impls on records (#1200) --- resources/META-INF/babashka/deps.edn | 1 - sci | 2 +- src/babashka/main.clj | 7 ++++--- test/babashka/main_test.clj | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/resources/META-INF/babashka/deps.edn b/resources/META-INF/babashka/deps.edn index 0fe8864c..9f7e855c 100644 --- a/resources/META-INF/babashka/deps.edn +++ b/resources/META-INF/babashka/deps.edn @@ -124,7 +124,6 @@ io.lambdaforge/datalog-parser {:mvn/version "0.1.9"} clj-stacktrace/clj-stacktrace {:mvn/version "0.2.8"} clojure-msgpack/clojure-msgpack {:mvn/version "1.2.1"} - cli-matic {:git/url "https://github.com/l3nz/cli-matic.git", :git/sha "9cd53ba7336363e3d06650dbad413b6f8b06e471"} cli-matic/cli-matic {:git/url "https://github.com/l3nz/cli-matic.git", :git/sha "9cd53ba7336363e3d06650dbad413b6f8b06e471"}} :classpath-overrides {org.clojure/clojure nil org.clojure/spec.alpha nil}} diff --git a/sci b/sci index 84bad66a..a668e0a8 160000 --- a/sci +++ b/sci @@ -1 +1 @@ -Subproject commit 84bad66a31bc04fe45ccd54711f5eb19c3581cc6 +Subproject commit a668e0a81d03ed869d427b0961c06e18a999119a diff --git a/src/babashka/main.clj b/src/babashka/main.clj index dc65b9c1..5b30a290 100644 --- a/src/babashka/main.clj +++ b/src/babashka/main.clj @@ -54,7 +54,8 @@ [sci.impl.namespaces :as sci-namespaces] [sci.impl.types :as sci-types] [sci.impl.unrestrict :refer [*unrestricted*]] - [sci.impl.vars :as vars]) + [sci.impl.vars :as vars] + [sci.impl.io :as sio]) (:gen-class)) (def windows? @@ -876,13 +877,13 @@ Use bb run --help to show this help output. (or (not run) (:prn cli-opts))) (if-let [pr-f (cond shell-out println - edn-out prn)] + edn-out sio/prn)] (if (sequential? res) (doseq [l res :while (not (pipe-signal-received?))] (pr-f l)) (pr-f res)) - (prn res)))) 0]] + (sio/prn res)))) 0]] (if stream? (recur) res))))) diff --git a/test/babashka/main_test.clj b/test/babashka/main_test.clj index 4dbe6ecb..26e56666 100644 --- a/test/babashka/main_test.clj +++ b/test/babashka/main_test.clj @@ -127,7 +127,7 @@ (is (= "localhost" (bb "#ordered/map ([:test \"localhost\"])" "(:test *input*)")))) (testing "bb doesn't wait for input if *input* isn't used" - (is (= "2\n" (test-utils/normalize (with-out-str (main/main "(inc 1)"))))))) + (is (= "2\n" (test-utils/normalize (sci/with-out-str (main/main "(inc 1)"))))))) (deftest println-test (is (= "hello\n" (test-utils/bb nil "(println \"hello\")"))))