Skip to content

Instantly share code, notes, and snippets.

@ajchemist
Created August 28, 2015 03:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajchemist/616d0cca1b7d1a4ac6c7 to your computer and use it in GitHub Desktop.
Save ajchemist/616d0cca1b7d1a4ac6c7 to your computer and use it in GitHub Desktop.
snapshot.el obsolete
(defun snapshot (in)
(interactive "DChoose directory to snapshot: ")
;; (let (( default-directory)))
(let* ((in (directory-file-name in))
(base (file-name-directory in))
(default-directory base)
(timestamp (format-time-string "%y%m%d-%H%M" (current-time)))
(out (expand-file-name
(format ".snapshot/%s-%s"
timestamp (file-name-nondirectory in))
base)))
(if (y-or-n-p (format "%s will be created?" out))
(copy-directory in out t t))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment