   (:require [clojure.string :as string])
   (:require [clojure.contrib.seq-utils :as seq-utils])
   (:use circle.utils.except)
+  (:require [clj-time.core :as time])
+  (:use [circle.db :only (with-conn)])
+  (:require [circle.model.shell-command :as model])
   (:require [fs]))
 
 (defn strip-dots

                          (for [name exe-names path (env-paths)]
                            (fs/join path name)))))

(defn shell-out [& args]
  (let [{:keys [out err exit]} (apply shell/sh :return-map true args)]
    (throw-if-not (and (= exit 0) (= err ""))
                  (throwf "Failed (%d): %s\n%s\n%s" exit args out err))))

; there is a program called autogen.sh on sourceforge that apparently
; does magic here


(defn init [& argv]
  (circle.repl/init)
  (circle.db/init)
  (clean-scratch-directory)
  (let [configuration (-> argv
                          first
                          io/reader
                          slurp
                          yaml/parse-string)]
    (process-configurations configuration)))


(defn -main []
