:author "Frank Duncan (frank@consxy.com)"
:serial t
:pathname "src/main"
- :components ((:file "package") (:file "base") (:file "server") (:file "cli") (:file "run"))
+ :components ((:file "package") (:file "base") (:file "server") (:file "cli") (:file "git") (:file "run"))
:depends-on (:herbie-utility :opera))
--- /dev/null
+(in-package #:candle)
+
+(defvar *git-location* "/usr/bin/git")
+
+(defun git (project cmd &rest args)
+ (let
+ ((err nil)
+ (out nil)
+ (code nil))
+ (setf
+ err
+ (with-output-to-string (err-str)
+ (setf out
+ (with-output-to-string (out-str)
+ (setf code
+ (sb-ext:process-exit-code
+ (sb-ext:run-program *git-location*
+ (append
+ (list "-C" (if project (project-dir project) *candle-dir*))
+ (list cmd)
+ args)
+ :output out-str
+ :error err-str
+ :wait t)))))))
+ (values (zerop code) code out err)))