Skip to content

Instantly share code, notes, and snippets.

@dysinger
Created March 24, 2009 15:23
Show Gist options
  • Save dysinger/84151 to your computer and use it in GitHub Desktop.
Save dysinger/84151 to your computer and use it in GitHub Desktop.
Gambit-C Scheme Script to Recursively Update Git Remotes
#!/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