Created
August 28, 2015 03:56
-
-
Save ajchemist/616d0cca1b7d1a4ac6c7 to your computer and use it in GitHub Desktop.
snapshot.el obsolete
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
(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