forked from melpa/melpa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
migrate
executable file
·33 lines (30 loc) · 844 Bytes
/
migrate
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
32
33
#!/bin/sh
:;exec emacs --script "$0" "$@"
(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))
(defun process-one (file-name)
(let ((config
(read-from-file
(expand-file-name ".config" (expand-file-name file-name "epkgs")))))
(princ
(pp-to-string
(cons
(intern file-name)
(plist-put
(plist-put
nil
:url
(plist-get config :url))
:fetcher
(plist-get config :fetcher)))
))))
(mapc 'process-one command-line-args-left)