diff options
author | Ludovic Courtès <ludo@gnu.org> | 2020-11-24 23:14:30 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2020-11-25 00:02:30 +0100 |
commit | 49eadd270c18c84e95df2677a5dfe9b3afc3036d (patch) | |
tree | a40cb8d56491f9375d8858d599741e08cf3cd71c /guix/build | |
parent | 112982526fc0c4405002b15798522436315f5e5b (diff) |
build-system/minify: Phases no longer return a Boolean.
* guix/build/minify-build-system.scm (minify): Use 'for-each' instead of
'every'. Call 'close-pipe' and call error when it returns non-zero.
(build): Use 'for-each' instead of 'every'.
(install): Remove trailing #t.
Diffstat (limited to 'guix/build')
-rw-r--r-- | guix/build/minify-build-system.scm | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/guix/build/minify-build-system.scm b/guix/build/minify-build-system.scm index 92158a033f..f7f51af301 100644 --- a/guix/build/minify-build-system.scm +++ b/guix/build/minify-build-system.scm @@ -23,6 +23,7 @@ #:use-module (guix build utils) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) + #:use-module (ice-9 match) #:use-module (ice-9 popen) #:export (%standard-phases minify-build @@ -42,14 +43,17 @@ (minified (open-pipe* OPEN_READ "uglify-js" file))) (call-with-output-file installed (cut dump-port minified <>)) - #t)) + (match (close-pipe minified) + (0 #t) + (status + (error "uglify-js failed" status))))) (define* (build #:key javascript-files #:allow-other-keys) (let ((files (or javascript-files (find-files "src" "\\.js$")))) (mkdir-p "guix/build") - (every (cut minify <> #:directory "guix/build/") files))) + (for-each (cut minify <> #:directory "guix/build/") files))) (define* (install #:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) @@ -60,8 +64,7 @@ (if (not (zero? (stat:size (stat file)))) (install-file file js) (error "File is empty: " file))) - (find-files "guix/build" "\\.min\\.js$"))) - #t) + (find-files "guix/build" "\\.min\\.js$")))) (define %standard-phases (modify-phases gnu:%standard-phases |