Skip to content

Commit dde3570

Browse files
committed
Add bootstrap
1 parent 29a87d1 commit dde3570

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

test/bootstrap.el

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
;;; bootstrap.el --- CI test bootstrap -*- lexical-binding: t; -*-
2+
;;
3+
;; Copyright (C) 2021 Jen-Chieh Shen
4+
;;
5+
;; This program is free software; you can redistribute it and/or modify
6+
;; it under the terms of the GNU General Public License as published by
7+
;; the Free Software Foundation, either version 3 of the License, or
8+
;; (at your option) any later version.
9+
10+
;; This program is distributed in the hope that it will be useful,
11+
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
;; GNU General Public License for more details.
14+
15+
;; You should have received a copy of the GNU General Public License
16+
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
17+
;;
18+
;;; Commentary:
19+
;;
20+
;; CI test bootstrap
21+
;;
22+
;;; Code:
23+
24+
(require 'package)
25+
26+
(setq user-emacs-directory (expand-file-name (make-temp-name ".emacs.d")
27+
"~")
28+
package-user-dir (expand-file-name (make-temp-name "tmp-elpa")
29+
user-emacs-directory))
30+
31+
(let* ((package-archives '(("melpa" . "https://melpa.org/packages/")
32+
("gnu" . "http://elpa.gnu.org/packages/")))
33+
(pkgs '(s)))
34+
(package-initialize)
35+
(package-refresh-contents)
36+
37+
(mapc (lambda (pkg)
38+
(unless (package-installed-p pkg)
39+
(package-install pkg)))
40+
pkgs)
41+
42+
(add-hook 'kill-emacs-hook
43+
`(lambda () (delete-directory ,user-emacs-directory t))))
44+
45+
;;; bootstrap.el ends here

0 commit comments

Comments
 (0)