Created
December 19, 2021 05:07
-
-
Save xandkar/6b1fd0a8ab0380dcfe1243fa6c7dd536 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
(define (find-git-dirs path) | |
(define (basename path) | |
(let-values ([(base name must-be-dir?) (split-path path)]) | |
(match name | |
['same (string->path ".")] | |
['up (string->path "..")] | |
[name name]))) | |
(define .git (string->path ".git")) | |
(find-files | |
(λ (path) | |
(and (equal? (file-or-directory-type path) 'directory) | |
(equal? (basename path) .git))) | |
path)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment