diff --git a/guix/build/node-build-system.scm b/guix/build/node-build-system.scm index 8c59ec086a..f1e9d00b5f 100644 --- a/guix/build/node-build-system.scm +++ b/guix/build/node-build-system.scm @@ -55,11 +55,24 @@ 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 modifications) +(define* (modify-json #:key (file "package.json") #:rest all-arguments) "Provide package.json modifying callbacks such as (delete-dependencies ...)" - (with-atomic-json-file-replacement - (apply compose modifications) - file)) + (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))) (define (delete-dependencies dependencies-to-remove) "Rewrite 'package.json' to allow the build to proceed without packages