X-Git-Url: https://njoseph.me/gitweb/babashka-scripts.git/blobdiff_plain/57e618f2b43f69a280d1e73cb06cb470bec24e56..269ff235d32dde012c671f258fcbdeba6504144f:/git-pull-all diff --git a/git-pull-all b/git-pull-all index 6b0de16..78c4000 100755 --- a/git-pull-all +++ b/git-pull-all @@ -7,7 +7,16 @@ (def default-root ".") -(defn list-dirs [root] (filter #(.isDirectory %) (.listFiles (io/file root)))) +(defn has-git-repo + [dir] + (first (filter #(= ".git" %) + (map #(.getName %) + (filter #(.isDirectory %) (.listFiles (io/file dir))))))) + +(defn list-dirs + [root] + (filter #(has-git-repo %) + (filter #(.isDirectory %) (.listFiles (io/file root))))) (defn git-pull [dir] (p/process ["git" "-C" dir "pull" "--rebase"]))