Emacs: Fix my/straight-check-last-update().

This commit is contained in:
tastytea 2020-03-26 01:21:53 +01:00
parent 070de22922
commit e7e4297adc
1 changed files with 10 additions and 8 deletions

View File

@ -1,6 +1,6 @@
;;; package-management.el --- Initialize package management -*- lexical-binding: t; -*-
;; Time-stamp: <2020-03-19T00:31:08+0100>
;; Time-stamp: <2020-03-26T01:21:25+0100>
;;; Commentary:
;; * Set up straight
@ -45,16 +45,18 @@
(straight-use-package 'use-package)
(defun my/straight-check-last-update ()
"Notify if 7 days have passed since the MELPA repo was last updated."
"Notify if 7 days have passed since the last package was built."
(let ((days 7))
(when (> (- (time-to-seconds)
(time-to-seconds
(file-attribute-modification-time
(file-attributes (expand-file-name "straight/repos/melpa"
user-emacs-directory)))))
(time-to-seconds (file-attribute-modification-time
(file-attributes (straight--build-dir)))))
(* 60 60 24 days))
(message "The last update was more than %d days ago." days))))
(add-hook 'after-init-hook #'my/straight-check-last-update)
;; Refresh repositories.
(straight-pull-package 'melpa)
(straight-pull-package 'gnu-elpa-mirror)
(straight-pull-package 'emacsmirror-mirror)
(message "The last package update was more than %d days ago." days))))
(add-hook 'emacs-startup-hook #'my/straight-check-last-update)
;; ;; Autocompile files on load.
;; (use-package auto-compile