Fetch package archives only when they are not cached locally

This commit is contained in:
Camden Dixie O'Brien 2021-01-01 00:00:34 +00:00
parent 88641c3d06
commit 04803253d7

View File

@ -21,13 +21,20 @@
(package-initialize) (package-initialize)
#+end_src #+end_src
We also need to fetch the package archives from ELPA and MELPA,
unless they have already been fetched:
#+begin_src emacs-lisp
(unless package-archive-contents
(package-refresh-contents))
#+end_src
** =use-package= ** =use-package=
The rest of this config grabs packages via =use-package=, so that The rest of this config grabs packages via =use-package=, so that
needs to be installed: needs to be installed:
#+begin_src emacs-lisp #+begin_src emacs-lisp
(when (not (package-installed-p 'use-package)) (when (not (package-installed-p 'use-package))
(package-refresh-contents)
(package-install 'use-package)) (package-install 'use-package))
#+end_src #+end_src