Created
March 24, 2009 15:23
-
-
Save dysinger/84151 to your computer and use it in GitHub Desktop.
Gambit-C Scheme Script to Recursively Update Git Remotes
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
#!/usr/bin/env gsi-script | |
;; -*- scheme -*- | |
(define (update cwd) | |
(for-each | |
(lambda (entry) | |
(let ((full-entry-path (path-expand entry cwd))) | |
(if (equal? 'directory (file-type full-entry-path)) | |
(if (equal? ".git" entry) | |
(begin | |
(pretty-print cwd) | |
(shell-command | |
(string-append "cd \"" cwd "\" && git remote update"))) | |
(if (not (or (equal? "." entry) | |
(equal? ".." entry))) | |
(update full-entry-path)))))) | |
(directory-files (list path: cwd ignore-hidden: #f)))) | |
(define (main path) (update path) 0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment