Add in a -not -path option to find to prevent the command finding

hidden directories (typically .git) to lint

Signed-off-by: Matthew B White <whitemat@uk.ibm.com>
This commit is contained in:
Matthew B White 2022-04-01 10:04:57 +01:00
parent a3ae179efb
commit 7d96262a85

View file

@ -10,7 +10,7 @@ function print() {
go install golang.org/x/tools/cmd/goimports@latest
dirs=("$(find . -name "*-go" -o -name "*-java" -o -name "*-javascript" -o -name "*-typescript")")
dirs=("$(find . -name "*-go" -o -name "*-java" -o -name "*-javascript" -o -name "*-typescript" -not -path '*/.*')")
for dir in $dirs; do
if [[ -d $dir ]] && [[ ! $dir =~ node_modules ]]; then
print "Linting $dir"