Created
August 15, 2010 10:20
-
-
Save html/525328 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defvar *files-modification-stamps* (make-hash-table :test #'equal)) | |
(defun load-modified-files() | |
(dolist (i (directory "src/**/*.lisp")) | |
(let* ((mtime-unix (sb-posix:stat-mtime (sb-posix:stat i))) | |
(cell (or (gethash i *files-modification-stamps*) (setf (gethash i *files-modification-stamps*) mtime-unix))) | |
(any-file-modified nil)) | |
(when (< cell mtime-unix) | |
(format t "Updated file ~A with last-modified time ~A~%" i mtime-unix) | |
(load (compile-file i)) | |
(setf (gethash i *files-modification-stamps*) mtime-unix) | |
(setf any-file-modified t)) | |
(if any-file-modified (redirect (make-action-url "debug-reset-sessions")))))) | |
(setf (request-hook :application :pre-action) (list #'load-modified-files)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment