Plaster

commonlisp
(ql:quickload '(legit bordeaux-threads)) (defun update-all (root) (let (success failure threads) (dolist (path (uiop:subdirectories root)) (unless (string= ".git" (car (last (pathname-directory path)))) (when (probe-file (merge-pathnames ".git/" path)) (format T "~& > Found git dir ~a~%" path) (push (bt:make-thread (lambda () (let ((repo (make-instance 'legit:repository :location path))) (if (ignore-errors (legit:pull repo)) (push path success) (push path failure))))) threads)) (update-all path))) (loop for thread in threads do (bt:join-thread thread)) (values success failure))) (defun report-update (success failures) (format T "~&~% >> ~d projects successfully updated, ~d projects failed." (length success) (length failures)) (format T "~& >> Failed projects: ~&~a" failures)) (multiple-value-call #'report-update (update-all (uiop:getcwd))) (quit)