Compare commits

...

2 commits

Author SHA1 Message Date
5ca1377ece Update repo todo as done 2024-07-30 16:40:43 +02:00
f4dc5002d9 Manage crafted-emacs repository 2024-07-30 16:40:09 +02:00
2 changed files with 20 additions and 4 deletions

View file

@ -28,7 +28,7 @@ This config also needs [[https://github.com/SystemCrafters/crafted-emacs][Crafte
* TODOS
** TODO Check out Crafted Emacs
** DONE Check out Crafted Emacs
This configuration relies on crafted emacs being checked out in
*~/.local/share/crafted-emacs* .

View file

@ -47,6 +47,19 @@
;; Wait for elpaca
(elpaca-wait)
(setq crafted-emacs-home "~/.local/share/crafted-emacs")
(defun check-crafted-emacs-fresh-repo ()
"Check if the crafted-emacs repo is fresh."
(if (file-exists-p crafted-emacs-home)
(progn
(message "Crafted Emacs repo exists. Pulling...")
(shell-command (format "cd %s && git pull" crafted-emacs-home)))
(progn
(message "Crafted Emacs repo does not exist. Cloning...")
(shell-command (format "git clone https://github.com/SystemCrafters/crafted-emacs.git %s" crafted-emacs-home)))
))
;; tangling to generate scripts for the local bin directory. This
;; causes the name of the scripts to be returned in the car of the
;; tangle command which is used to load the file. The net result is
@ -58,8 +71,12 @@
(if (file-newer-than-file-p src tgt)
(progn
(message "snamellit.org has been changed, tangling...")
(org-babel-tangle-file src tgt "emacs-lisp"))))
(org-babel-tangle-file src tgt "emacs-lisp")
;; this is a good time to check if the crafted-emacs repo is fresh
;; - we just updated the init.org file so we expect changes.
;; - or this is the initial tangling and we need the repo to exist.
(check-crafted-emacs-fresh-repo)
)))
;; Configure Crafted Emacs
(setq crafted-package-system 'elpaca)
@ -68,7 +85,6 @@
;; Startup Crafted Emacs
(setq crafted-emacs-home "~/.local/share/crafted-emacs")
(load (expand-file-name "modules/crafted-package-config" crafted-emacs-home))
(load (expand-file-name "modules/crafted-early-init-config" crafted-emacs-home))