How can I rewrite the function with spawn instead of exec?

(defui build-configuration [this]
  [:button {:type "button"
            :style {:margin-left 15}}
   "Build"]
  :click #(do
            (when (:builder @state)
              (kill-process (:builder @state)))
            (let [builder (.exec child-process (str "cd " (:path @this)
                                                    (if (= (:build @this) 
"dev")
                                                      (str (if (= 
(:platform @this) "android")
                                                             " && adb 
reverse tcp:8081 tcp:8081 && adb reverse tcp:3449 tcp:3449"
                                                             "")
                                                           " && re-natal 
use-" (:platform @this) "-device " (:device @this)
                                                           " && re-natal 
use-figwheel && lein figwheel " (:platform @this))
                                                      " && lein 
prod-build")))]
              (-> (.-stdout builder)
                  (.on "data" (fn[data]
                                (println data))))
              (-> (.-stderr builder)
                  (.on "data" (fn[data]
                                (println data))))
              (swap! state assoc :builder builder))))

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/clojurescript.

Reply via email to