Skip to content

Commit a7af7a4

Browse files
committed
Adjust *color-enabled* default logic to match description
1 parent 692826c commit a7af7a4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/clj_commons/ansi.clj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
(defn- to-boolean
1616
[s]
1717
(when s
18-
(= "true" (-> s str/trim str/lower-case))))
18+
(-> s str/trim str/lower-case)))
1919

2020
(def ^:dynamic *color-enabled*
2121
"Determines if ANSI colors are enabled; color is a deliberate misnomer, as we lump
@@ -33,9 +33,9 @@
3333
The nrepl.core check has been verified to work with Cursive, with `lein repl`, and with `clojure` (or `clj`)."
3434
(if (seq (System/getenv "NO_COLOR"))
3535
false
36-
(let [flag (to-boolean (System/getProperty "clj-commons.ansi.enabled"))]
36+
(let [flag (System/getProperty "clj-commons.ansi.enabled")]
3737
(cond
38-
flag flag
38+
(some? flag) (to-boolean flag)
3939

4040
(is-ns-available? 'nrepl.core)
4141
true

0 commit comments

Comments
 (0)