Add in a -not -path option to find to prevent the command finding (#699)

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 13:40:28 +01:00 committed by GitHub
parent a3ae179efb
commit 0262d264d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,7 +10,7 @@ function print() {
go install golang.org/x/tools/cmd/goimports@latest 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 for dir in $dirs; do
if [[ -d $dir ]] && [[ ! $dir =~ node_modules ]]; then if [[ -d $dir ]] && [[ ! $dir =~ node_modules ]]; then
print "Linting $dir" print "Linting $dir"