mirror of
https://github.com/penpot/penpot.git
synced 2025-01-24 23:49:45 -05:00
🎉 Add srepl helpers for run and print available tasks
This commit is contained in:
parent
ada0938e27
commit
7626d912b9
1 changed files with 18 additions and 1 deletions
|
@ -9,7 +9,24 @@
|
|||
#_:clj-kondo/ignore
|
||||
(:require
|
||||
[app.common.logging :as l]
|
||||
[app.common.pprint :as p]
|
||||
[app.srepl.fixes :as f]
|
||||
[app.srepl.helpers :as h]
|
||||
[app.srepl.fixes :as f]))
|
||||
[clojure.pprint :refer [pprint]]))
|
||||
|
||||
;; Empty namespace as main entry point for Server REPL
|
||||
|
||||
(defn print-available-tasks
|
||||
[system]
|
||||
(let [tasks (:app.worker/registry system)]
|
||||
(p/pprint (keys tasks) :level 200)))
|
||||
|
||||
|
||||
(defn run-task!
|
||||
([system name]
|
||||
(run-task! system name {}))
|
||||
([system name params]
|
||||
(let [tasks (:app.worker/registry system)]
|
||||
(if-let [task-fn (get tasks name)]
|
||||
(task-fn params)
|
||||
(l/warn :hint "no task found" :name name)))))
|
||||
|
|
Loading…
Add table
Reference in a new issue