1
0
Fork 0
mirror of https://github.com/correl/melpa.git synced 2024-12-29 11:09:24 +00:00
melpa/migrate
Georgi Valkov f4d2a1bf4d Fix portability problem with #!/usr/bin/env (issue )
Passing the 'script' option to emacs doesn't work as expected
on Linux, since the shebang is evaluated as:
  #!/usr/bin/env "emacs --script"
2012-07-17 13:10:18 +03:00

33 lines
844 B
Text
Executable file

#!/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)