Promote hookwrapper to procedure

This commit is contained in:
Tom Willemse 2014-03-01 21:07:22 +01:00
parent aacc242fb3
commit dba15ac990

View file

@ -46,6 +46,11 @@
(for-each print-repository-location (for-each print-repository-location
(sort repositories repository-location<?))) (sort repositories repository-location<?)))
(define (maybe-install-hooks. repo)
"Install hooks for REPO unless it's excluded."
(unless (member (repo-name repo) config-exclusion-list)
(install-hooks (repo-location repo))))
(define (print-config repo) (define (print-config repo)
"Print the configuration for REPO." "Print the configuration for REPO."
(display (string-upcase (repo-name repo))) (display (string-upcase (repo-name repo)))
@ -195,15 +200,11 @@ Installs the configured hooks into each repository or the given
repository." repository."
(cond (cond
((equal? sub "init") ((equal? sub "init")
(let ((hookwrapper (if repository
(lambda (r) (if (known? repository)
(unless (member (repo-name r) config-exclusion-list) (maybe-install-hooks. (make <repository> repository))
(install-hooks (repo-location r)))))) (format #t "Unknown repository: ~a~%" repository))
(if repository (for-each maybe-install-hooks. repositories)))))
(if (known? repository)
(hookwrapper (make <repository> repository))
(format #t "Unknown repository: ~a~%" repository))
(for-each hookwrapper repositories))))))
(define-command (list . args) (define-command (list . args)
"List information about every repository." "List information about every repository."