Created
August 6, 2012 10:08
-
-
Save nicferrier/3273143 to your computer and use it in GitHub Desktop.
marmalade test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:;exec emacs -batch -Q -l "$0" -f marmalade-test "$@" | |
;; Test marmalade from the command line by attempting to install the | |
;; fakir package. | |
;; It's all done in a new temporary directory (based on the pid of the | |
;; emacs process) so it should be very isolated from any emacs you | |
;; have running. | |
(defun marmalade-test () | |
(interactive) | |
(let ((dir (concat | |
temporary-file-directory | |
(format "marmalade-%d/" (emacs-pid)))) | |
(extra-repo | |
(if t | |
"http://marmalade-repo.org/packages/" | |
"http://localhost:3000/packages/"))) | |
(when (file-exists-p dir) | |
(delete-directory dir 't)) | |
(make-directory dir) | |
(setq package-user-dir | |
(concat dir ".elpa")) | |
(setq package-archives | |
`(("gnu" . "http://elpa.gnu.org/packages/") | |
("marmalade" . ,extra-repo))) | |
(package-initialize) | |
(package-refresh-contents) | |
(condition-case nil | |
(package-install 'fakir) | |
(error (message "failed to install package!"))))) | |
;;; marmalade-test.el ends |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment