+(in-package #:candle)
+
+(defun import-package (pkg)
+ (asdf:load-system pkg))
+
+(defun run-task (task)
+ (format t "~%~c[1;33mRunning ~:(~A~)~c[0m~%" #\Esc (getf task :name) #\Esc)
+ (eval (getf task :directions))
+; (format t "~c[1;31mFailed doc check!~c[0m~%" #\Esc #\Esc)
+ (format t "~c[1;32m- ~:(~A~) Passed!~c[0m~%" #\Esc (getf task :name) #\Esc))
+
+(defun run ()
+ (if
+ (not (probe-file ".candle"))
+ :dot-candle-absent
+ (with-open-file (str ".candle")
+ (asdf:initialize-source-registry `(:source-registry (:tree ,(car (directory "."))) :INHERIT-CONFIGURATION))
+ (mapcar #'import-package (cdr (read str)))
+ (let
+ ((candle-definition (read str)))
+ (format t "Running tasks for ~(~A~)~%" (getf candle-definition :name))
+ (mapcar #'run-task (getf candle-definition :tasks))))))