Skip to content

Commit

Permalink
tweak(straight): refactor and rename straight cache cleaning function
Browse files Browse the repository at this point in the history
  • Loading branch information
abougouffa committed Oct 21, 2023
1 parent 733c89b commit f06b06a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions core/me-bootstrap.el
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,9 @@
use-package-expand-minimally (not minemacs-debug))

;;;###autoload
(defun +straight-compile-prune-cache ()
(defun +straight-prune-build-cache ()
(let* ((straight-dir (file-name-concat straight-base-dir "straight/"))
(default-directory straight-dir)
(builds (seq-filter
(lambda (name)
(not (member name (list straight-build-dir
Expand All @@ -62,10 +63,9 @@
"repos"))))
(directory-files straight-dir nil "[^.][^.]?$"))))
(dolist (file builds)
(let ((default-directory straight-dir))
(if (file-directory-p file)
(delete-directory file 'recursive 'trash)
(delete-file file 'trash))))))
(if (file-directory-p file)
(delete-directory file 'recursive 'trash)
(delete-file file 'trash)))))


(provide 'me-bootstrap)
Expand Down
2 changes: 1 addition & 1 deletion core/me-loaddefs.el
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ Unmount eCryptfs' private directory." t)

;;; Generated autoloads from me-bootstrap.el

(autoload '+straight-compile-prune-cache "me-bootstrap")
(autoload '+straight-prune-build-cache "me-bootstrap")


;;; Generated autoloads from ../modules/extras/me-cape-super-capf.el
Expand Down
2 changes: 1 addition & 1 deletion init.el
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@
(+info! "Trying to clean outdated native compile cache")
;; Delete outdated natively compiled files when Emacs become idle
(+shutup! (native-compile-prune-cache)))
(+shutup! (+straight-compile-prune-cache)))
(+shutup! (+straight-prune-build-cache)))


(+log! "Loaded init.el")
Expand Down

0 comments on commit f06b06a

Please sign in to comment.