mirror of
https://github.com/correl/melpa.git
synced 2024-12-22 03:00:11 +00:00
add a migrate script
This commit is contained in:
parent
308079d39f
commit
aa6be4b309
1 changed files with 37 additions and 0 deletions
37
migrate
Executable file
37
migrate
Executable file
|
@ -0,0 +1,37 @@
|
|||
#!/usr/bin/env emacs --script
|
||||
|
||||
(defun read-from-file (file-name)
|
||||
"read one lisp expression from a file"
|
||||
(cond
|
||||
((file-exists-p file-name)
|
||||
(with-temp-buffer
|
||||
(insert-file-contents-literally file-name)
|
||||
(goto-char (point-min))
|
||||
(car
|
||||
(read-from-string
|
||||
(buffer-substring-no-properties (point-min) (point-max))))))))
|
||||
|
||||
(message (prin1-to-string command-line-args-left))
|
||||
(when command-line-args-left
|
||||
(let* ((file-name (car command-line-args-left))
|
||||
(config
|
||||
(read-from-file
|
||||
(message (expand-file-name ".config" (expand-file-name file-name "epkgs")))))
|
||||
(master
|
||||
(read-from-file
|
||||
(expand-file-name "master" (expand-file-name file-name "epkgs")))))
|
||||
(princ
|
||||
(pp-to-string
|
||||
(cons
|
||||
(intern file-name)
|
||||
(plist-put
|
||||
(plist-put
|
||||
(plist-put
|
||||
nil
|
||||
:summary
|
||||
(plist-get master :summary))
|
||||
:url
|
||||
(plist-get config :url))
|
||||
:fetcher
|
||||
(plist-get config :fetcher)))
|
||||
))))
|
Loading…
Reference in a new issue