File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 8
8
(str/replace message " [" " \\ [" ))
9
9
10
10
(defn- notify [title-postfix message]
11
+ {:pre [(string? title-postfix) (string? message)]}
11
12
(try
12
13
(shell/sh " terminal-notifier" " -message" (escape message) " -title" (str " doo - " (escape title-postfix)))
13
14
(catch Exception ex
28
29
(defn handle-notifications [out opts]
29
30
(when (:notify opts)
30
31
(let [old-status (notify-title @last-run)
31
- new (reset! last-run (get-assertion-string @ out))
32
+ new (reset! last-run (get-assertion-string out))
32
33
new-status (notify-title new)
33
34
changed (not= new-status old-status)]
34
35
(when (or changed (= :always (:notify opts)))
Original file line number Diff line number Diff line change 1
1
(ns doo.shell
2
2
" Rewrite of clojure.java.shell to have access to the output stream."
3
3
(:require [clojure.java.io :as io]
4
- [doo.notifier :as notifier]
5
4
[doo.utils :as utils])
6
5
(:import (java.io StringWriter BufferedReader InputStreamReader File)
7
6
(java.nio.charset Charset)))
77
76
(let [proc (exec! cmd (:exec-dir opts))
78
77
{:keys [out err]} (capture-process! proc opts)
79
78
exit-code (.waitFor proc)]
80
- (notifier/handle-notifications out opts)
81
79
{:exit exit-code :out @out :err @err})))
Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ in project.clj.\n")
217
217
; ; FIX: there is probably a bug regarding the incorrect use of builds
218
218
; ; Important to add sources to the classpath
219
219
(run-local-project (add-sources project' source-paths)
220
- '(require 'cljs.build.api 'doo.core 'doo.karma)
220
+ '(require 'cljs.build.api 'doo.core 'doo.karma 'doo.notifier )
221
221
`(let [compiler# (cljs.build.api/add-implicit-options ~compiler)]
222
222
(doseq [js-env# ~js-envs]
223
223
(doo.core/assert-compiler-opts js-env# compiler#))
@@ -239,7 +239,8 @@ in project.clj.\n")
239
239
(Thread/sleep 1000 ))
240
240
(doseq [js-env# non-karma-envs#]
241
241
(doo.core/print-envs js-env#)
242
- (doo.core/run-script js-env# compiler# ~opts))
242
+ (let [r# (doo.core/run-script js-env# compiler# ~opts)]
243
+ (doo.notifier/handle-notifications (:out r#) ~opts)))
243
244
(when @karma-on?#
244
245
(apply doo.core/print-envs karma-envs#)
245
246
(doo.core/karma-run! ~opts))))))
You can’t perform that action at this time.
0 commit comments