From 0dee6251426c78542286fd9e93b21509c9e0e74a Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Wed, 18 Dec 2019 04:53:31 +0300 Subject: [PATCH] Feat(locate-all): Exclude submodules Check submodules by files `.git`. --- locate-all | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 -- 2.39.2