fix #1180: limit bb tasks output to first line of docstring

This commit is contained in:
Michiel Borkent 2022-02-24 12:28:11 +01:00
parent 125e1c1412
commit 83c610ca0f
3 changed files with 7 additions and 3 deletions

View file

@ -7,6 +7,7 @@ For a list of breaking changes, check [here](#breaking-changes).
### Fixes
- [#1181](https://github.com/babashka/babashka/issues/1181): clojure.test report does not respect *test-out* correctly
- [#1180](https://github.com/babashka/babashka/issues/1180): limit bb tasks output to first line of docstring
## 0.7.5 (2022-02-16)

View file

@ -1,6 +1,5 @@
(ns babashka.impl.tasks
(:require [babashka.deps :as deps]
[babashka.impl.classpath :as cp]
[babashka.impl.common :refer [ctx bb-edn debug]]
[babashka.process :as p]
[clojure.core.async :refer [<!!]]
@ -421,7 +420,9 @@
:let [task (get tasks (symbol k))]]
(println (str (format fmt k)
(when-let [d (doc-from-task sci-ctx tasks task)]
(str " " d))))))
(let [first-line (-> (str/split-lines d)
first)]
(str " " first-line)))))))
(println "No tasks found."))))
(defn run

View file

@ -304,7 +304,9 @@
(test-utils/with-config "{:paths [\"test-resources/task_scripts\"]
:tasks {:requires ([tasks :as t])
task1
{:doc \"task1 doc\"
{:doc \"task1 doc
more stuff here
even more stuff here\"
:task (+ 1 2 3)}
task2
{:doc \"task2 doc\"