|
69 | 69 |
|
70 | 70 | watch-ci |
71 | 71 | {:requires [[bb.dl-and-run :as dl] |
72 | | - [clojure.pprint :as pp]] |
| 72 | + [bb.watch-ci :as watch-ci]] |
73 | 73 | :doc "Watch the CI status for a branch until it passes." |
74 | 74 | :examples [["bb watch-ci --branch current" "Check currently checked out branch in MB_DIR repo"]] |
75 | 75 | :task |
|
79 | 79 | :msg "What branch should we check?" |
80 | 80 | :short "-b" |
81 | 81 | :long "--branch BRANCH" |
82 | | - :choices (delay (t/list-branches (t/mb-env))) |
| 82 | + :choices (delay (t/list-branches (t/mb-dir))) |
83 | 83 | :choices-doc "list of branches" |
84 | 84 | :prompt :select}) |
85 | 85 | branch (if (= "current" branch) |
86 | | - (let [current (str/trim |
87 | | - (:out (shell {:dir (t/env "MB_DIR" (fn [] |
88 | | - (println "Please set MB_DIR to your metabase repo!") |
89 | | - (System/exit 1))) :out :string} |
90 | | - "git rev-parse --abbrev-ref HEAD")))] |
91 | | - (do (println (c/green (c/bold "Checking current branch: " current))) |
| 86 | + (let [current (t/current-branch)] |
| 87 | + (do (println (c/green (c/bold "Using current branch: " (t/current-branch)))) |
92 | 88 | current)) |
93 | 89 | branch)] |
94 | | - (pp/pprint dl/pretty) |
95 | | - (loop [] |
96 | | - (let [check (dl/checks-for-branch branch)] |
97 | | - (print (str "\n[ " (.format (java.text.SimpleDateFormat. "hh:mm:ss a") (java.util.Date.)) " ]")) |
98 | | - (doseq [[status count] check] (print (str/join (repeat count (dl/pretty status)))) (print "|")) (flush) |
99 | | - (when-not (= (keys check) [:success]) |
100 | | - (Thread/sleep 10000) (recur))))))} |
| 90 | + (watch-ci/branch branch)))} |
101 | 91 |
|
102 | 92 | install-autotab {:doc "Prints shell code to autocomplete tasks using bb. |
103 | 93 | Note: for fish shell please make sure ~/.config/fish/completions exists." |
|
0 commit comments