From: Oleg Broytman Date: Wed, 18 Dec 2019 01:53:31 +0000 (+0300) Subject: Feat(locate-all): Exclude submodules X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=0dee6251426c78542286fd9e93b21509c9e0e74a;p=git-scripts.git Feat(locate-all): Exclude submodules Check submodules by files `.git`. --- diff --git a/locate-all b/locate-all index afaa3e7..841721e 100755 --- a/locate-all +++ b/locate-all @@ -1,4 +1,13 @@ #! /bin/sh -locate -b \*.git | sed 's!/\.git$!!' | +locate -b \*.git | grep -v "/archive/SQLObject/\|/archive/cheetah3/\|/third-party/\|$HOME/tmp/" | + 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