style: Gracefully handle errors such as EACCES when opening files.

* guix/scripts/style.scm (guix-style): Wrap body in
'with-error-handling'.
This commit is contained in:
Ludovic Courtès 2021-12-18 22:49:40 +01:00
parent a9892f8f2d
commit f6e79ef108
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -543,6 +543,7 @@ (define (parse-options)
edit-expression/dry-run
edit-expression))
(policy (assoc-ref opts 'input-simplification-policy)))
(with-error-handling
(for-each (lambda (package)
(simplify-package-inputs package #:policy policy
#:edit-expression edit))
@ -553,4 +554,4 @@ (define (parse-options)
(sort (if (null? packages)
(fold-packages cons '() #:select? (const #t))
packages)
(negate package-location<?)))))
(negate package-location<?))))))