Sort repositories

Upon saving, sort the repositories alphabetically by `basename'.  When
`-l' is provided sort before output by location.
This commit is contained in:
Tom Willemsen 2012-07-01 20:25:03 +02:00
parent 58dcd2fa57
commit 6da8b42171

View file

@ -51,6 +51,12 @@ gitto [options]
(if (not (file-exists? data-dir))
(mkdir data-dir))
;; Sort first
(set! repositories
(sort repositories
(lambda (s1 s2)
(string<? (basename s1) (basename s2)))))
(let ((port (open-output-file repositories-file)))
(write repositories port)
(close-port port)))
@ -114,7 +120,7 @@ gitto [options]
(for-each (lambda (repo)
(display repo)
(newline))
repositories))
(sort repositories string<?)))
(define option-spec
`((version (single-char #\v))