summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--guix/build/node-build-system.scm21
1 files changed, 4 insertions, 17 deletions
diff --git a/guix/build/node-build-system.scm b/guix/build/node-build-system.scm
index 0cd05fc0e8..c153a2fcc9 100644
--- a/guix/build/node-build-system.scm
+++ b/guix/build/node-build-system.scm
@@ -67,24 +67,11 @@ to be written as json to the replacement FILE."
(lambda (in out)
(scm->json (proc (json->scm in)) out))))
-(define* (modify-json #:key (file "package.json") #:rest all-arguments)
+(define* (modify-json #:key (file "package.json") #:rest modifications)
"Provide package.json modifying callbacks such as (delete-dependencies ...)"
- (let
- (
- (modifications
- (let loop ((arguments all-arguments))
- (cond
- ((null? arguments) '())
- ((keyword? (car arguments)) (loop (cddr arguments)))
- (else (cons (car arguments) (loop (cdr arguments))))))))
- (with-atomic-json-file-replacement
- (lambda (package)
- (fold
- (lambda (modification package)
- (modification package))
- package
- modifications))
- file)))
+ (with-atomic-json-file-replacement
+ (apply compose modifications)
+ file))
(define (delete-dependencies dependencies-to-remove)
"Rewrite 'package.json' to allow the build to proceed without packages