File tree Expand file tree Collapse file tree 3 files changed +24
-11
lines changed
Expand file tree Collapse file tree 3 files changed +24
-11
lines changed Original file line number Diff line number Diff line change 11(ns clawe.cli
22 (:require
33 [clojure.string :as string]
4+ [cheshire.core :as json]
45 [clawe.config :as clawe.config]))
56
67; ; TODO support ops like these with smth like -j
1314(defn workspace-def [{:as _opts :keys [title]}]
1415 (clawe.config/workspace-def title))
1516
17+ (defn workspace-def-j [opts]
18+ (->>
19+ (workspace-def opts)
20+ (json/generate-string )
21+ println))
22+
1623(defn workspace-dir [opts]
17- (-> opts workspace-def :workspace/directory ))
24+ (-> opts workspace-def :workspace/directory
25+ println))
1826
1927(defn preferred-index [opts]
20- (-> opts workspace-def :workspace/preferred-index ))
28+ (-> opts workspace-def :workspace/preferred-index
29+ println))
2130
2231(defn git-status [opts]
23- (-> opts workspace-def :git/status ))
32+ (-> opts workspace-def :git/status
33+ println))
2434
2535(defn repo-dirs [opts]
2636 (->>
2737 (clawe.config/workspace-defs )
28- (map (fn [[k def ]] [k (:workspace/directory def )]))))
38+ (map (fn [[k def ]] [k (:workspace/directory def )]))
39+ println))
2940
3041(defn my-repo-dirs [opts]
3142 (->>
3243 (clawe.config/workspace-defs )
3344 (filter (comp :workspace/directory second))
3445 (filter (fn [[_ def ]] (string/includes? (:workspace/directory def ) " russmatney" )))
3546 (map (fn [[k def ]] [k (:workspace/directory def )]))
36- (map str)
37- (string/join " \n " )
38- ; ; (into {})
47+ ; ; (map str)
48+ ; ; (string/join "\n")
49+ (into {})
50+ (json/generate-string )
51+ println
3952 ))
Original file line number Diff line number Diff line change 1212 [timer :as timer]))
1313
1414
15- (timer/print-since " clawe.config ns loading" )
15+ ; ; (timer/print-since "clawe.config ns loading")
1616
1717
1818(def clawe-config-path " .config/clawe/clawe.edn" )
3636 (assoc :home-dir (str (fs/home )))
3737 (->> ; ; local should overwrite global
3838 (merge (read-config clawe-local-config-path))))]
39- (timer/print-since " parsed and returning clawe config" )
39+ ; ; (timer/print-since "parsed and returning clawe config")
4040 conf))
4141
4242(defsys ^:dynamic *config*
4343 :start
44- (timer/print-since " starting clawe.config system" )
44+ ; ; (timer/print-since "starting clawe.config system")
4545 (atom (->config )))
4646
4747(declare write-config )
Original file line number Diff line number Diff line change 1111 (reset! last-t now)
1212 (println " |" (when old-last (- now old-last)) " \t |" (- now @start-t) " \t |" line))))
1313
14- (print-since " timer ns loaded" )
14+ ; ; (print-since "timer ns loaded")
You can’t perform that action at this time.
0 commit comments