mirror of
https://github.com/correl/melpa.git
synced 2024-11-14 19:19:32 +00:00
Add functions that export to json
The list of recipies and the packages in the archive can be serialized to json with: - package-build-alist-as-json - package-build-archive-alist-as-json The json files can be used to simplify the generation of the html index or serve as some form of API for non-lisp clients.
This commit is contained in:
parent
3fe20de5b2
commit
3f533208c5
1 changed files with 14 additions and 1 deletions
|
@ -645,9 +645,22 @@ FILES is a list of (SOURCE . DEST) relative filepath pairs."
|
|||
(expand-file-name "archive-contents"
|
||||
package-build-archive-dir)))))
|
||||
|
||||
|
||||
(package-build-initialize)
|
||||
|
||||
;; Utility functions
|
||||
(autoload 'json-encode "json")
|
||||
|
||||
(defun package-build-alist-as-json (fn)
|
||||
(interactive)
|
||||
(with-temp-file fn
|
||||
(insert (json-encode package-build-alist))))
|
||||
|
||||
(defun package-build-archive-alist-as-json (fn)
|
||||
(interactive)
|
||||
(with-temp-file fn
|
||||
(insert (json-encode package-build-archive-alist))))
|
||||
|
||||
|
||||
(provide 'package-build)
|
||||
|
||||
;; Local Variables:
|
||||
|
|
Loading…
Reference in a new issue