Created
January 27, 2009 06:52
-
-
Save travisbhartwell/53216 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
(defun find-git-repos-internal (dir found-dirs) | |
(cond ((file-directory-p dir) | |
(or (char-equal ?/ (aref dir(1- (length dir)))) | |
(setq dir (file-name-as-directory dir))) | |
(let ((lst (directory-files dir nil nil t)) | |
fullname file) | |
(while lst | |
(setq file (car lst)) | |
(setq lst (cdr lst)) | |
(setq fullname (concat dir file)) | |
(cond ((member file '("." ".."))) | |
((file-exists-p (concat fullname "/.git")) | |
(message "Found a git directory at %s" fullname) | |
(message "directories so far: %s" found-dirs) | |
(setq found-dirs (add-to-list 'found-dirs fullname))) | |
(t | |
(find-git-repos-internal fullname found-dirs)))))) | |
(t | |
(message "Directories: %s" found-dirs) | |
found-dirs))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment