Skip to content

Instantly share code, notes, and snippets.

@html
Created August 15, 2010 10:20
Show Gist options
  • Save html/525328 to your computer and use it in GitHub Desktop.
Save html/525328 to your computer and use it in GitHub Desktop.
(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