X-Git-Url: https://code.consxy.com/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Frun.lisp;h=d9797350547fe8403e6f0679435fe6383f644487;hb=a50fef6f3bacc24a838e81092104f3082b15bad4;hp=fa9edbe45600258e7c5fd51b87cb9ec552a2984d;hpb=59e9f7983efcc1ee08609b075ea8345e5318b125;p=candle diff --git a/src/main/run.lisp b/src/main/run.lisp index fa9edbe..d979735 100644 --- a/src/main/run.lisp +++ b/src/main/run.lisp @@ -5,11 +5,22 @@ (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)) + (if + (eval (getf task :directions)) + (progn (format t "~c[1;32m- ~:(~A~) Passed!~c[0m~%" #\Esc (getf task :name) #\Esc) t) + (format t "~c[1;31m- ~:(~A~) Failed!~c[0m~%" #\Esc (getf task :name) #\Esc))) (defun run () + "RUN => RESULT + +ARGUMENTS AND VALUES: + + RESULT: a boolean, whether the process was successful + +DESCRIPTION: + + Runs the script specified by the .candle file in the current directory. + When completed, the boolean will be returned if it was successful or not." (if (not (probe-file ".candle")) :dot-candle-absent @@ -19,4 +30,4 @@ (let ((candle-definition (read str))) (format t "Running tasks for ~(~A~)~%" (getf candle-definition :name)) - (mapcar #'run-task (getf candle-definition :tasks)))))) + (every #'identity (mapcar #'run-task (getf candle-definition :tasks)))))))