]> git.phdru.name Git - git-scripts.git/blobdiff - locate-all
Refactor(locate-all): Reorder excluded directories
[git-scripts.git] / locate-all
index 21daa91de58cf5d2b274ddddf1fd5e5dbb230ef9..e348424a0e2739b791c87cc649e283a4520a5351 100755 (executable)
@@ -1,2 +1,13 @@
 #! /bin/sh
-locate -b \*.git | sed 's!/\.git$!!' | sort | uniq >locate-all.list
+locate -b \*.git |
+   grep -v "/archive/SQLObject/\|/archive/cheetah3/\|$HOME/tmp/\|/third-party/" |
+   while read path; do
+      if [ -d "$path" ]; then # skip files `.git` - they're submodules
+         if [ "`basename \"$path\"`" = .git ]; then
+            dirname "$path"
+         else
+            echo "$path"
+         fi
+      fi
+   done |
+   LC_ALL=C sort | uniq > locate-all.list