blob 3f45aa0c77e2805d3c1a914966185e76e4fc22cc 1051 bytes (raw)
name: scripts/npm-import # note: path name is non-authoritative(*)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
| | #! /bin/sh
# -*- scheme -*-
unset LANG LC_ALL
unset GUILE_AUTO_COMPILE GUILE_LOAD_COMPILED_PATH
exec ${GUILE-guile} --no-auto-compile -L $PWD -C $PWD -e '(@@ (npm-import) main)' -s "$0" ${1+"$@"}
!#
(define-module (npm-import)
#:use-module (ice-9 pretty-print)
#:use-module (srfi srfi-26)
#:use-module (guix import npm)
#:use-module (gnu packages npm))
(define (package->define entry)
`(define-public ,(string->symbol (string-append "node-" (car entry)))
,(cadr entry)))
(define (name->node.scm package-name)
(format (current-error-port) "package: ~a\n" package-name)
(let* ((packages-alist (recursive-import package-name))
(defines (map package->define packages-alist))
(file (open-file (string-append "node-" package-name ".scm") "w")))
(map (cut pretty-print <> file) defines)
(close file)))
(define (main args)
(let ((files (cdr (command-line))))
(when (null? files)
(format (current-error-port) "Usage: npm-import NPM-PACKAGE-NAME\n")
(exit 1))
(for-each name->node.scm files)))
|
debug log:
solving 3f45aa0 ...
found 3f45aa0 in https://yhetil.org/guix/87shtiz8f7.fsf@gnu.org/
applying [1/1] https://yhetil.org/guix/87shtiz8f7.fsf@gnu.org/
diff --git a/scripts/npm-import b/scripts/npm-import
new file mode 100755
index 0000000..3f45aa0
Checking patch scripts/npm-import...
Applied patch scripts/npm-import cleanly.
index at:
100755 3f45aa0c77e2805d3c1a914966185e76e4fc22cc scripts/npm-import
(*) Git path names are given by the tree(s) the blob belongs to.
Blobs themselves have no identifier aside from the hash of its contents.^
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.