make tangling of init.org more robust

This commit is contained in:
Peter Tillemans 2024-08-15 13:14:23 +02:00
parent 6cc0a9871c
commit bcf0d2b445

View file

@ -75,16 +75,15 @@
(use-package ob-tangle)
(let ((src (concat user-emacs-directory "init.org"))
(tgt (concat user-emacs-directory "init.el")))
(if (file-newer-than-file-p src tgt)
(progn
(message "init.org has been changed, tangling...")
(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.
(message "checking crafted emacs repo...")
(check-crafted-emacs-fresh-repo)
)))
(when (file-newer-than-file-p src tgt)
(delete-file tgt)
(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.
(message "checking crafted emacs repo...")
(check-crafted-emacs-fresh-repo)
))
;; Configure Crafted Emacs
(setq crafted-package-system 'elpaca)