build: make build/goimports.sh more potable

release/1.8
hackyminer 6 years ago
parent 461291882e
commit 909e968ebb
No known key found for this signature in database
GPG Key ID: 46D453DDCA4B766F
  1. 22
      build/goimports.sh

@ -1,18 +1,18 @@
#!/usr/bin/env bash #!/bin/sh
find_files() { find_files() {
find . -not \( \ find . ! \( \
\( \ \( \
-wholename '.github' \ -path '.github' \
-o -wholename './build/_workspace' \ -o -path './build/_workspace' \
-o -wholename './build/bin' \ -o -path './build/bin' \
-o -wholename './crypto/bn256' \ -o -path './crypto/bn256' \
-o -wholename '*/vendor/*' \ -o -path '*/vendor/*' \
\) -prune \ \) -prune \
\) -name '*.go' \) -name '*.go'
} }
GOFMT="gofmt -s -w"; GOFMT="gofmt -s -w"
GOIMPORTS="goimports -w"; GOIMPORTS="goimports -w"
find_files | xargs $GOFMT; find_files | xargs $GOFMT
find_files | xargs $GOIMPORTS; find_files | xargs $GOIMPORTS

Loading…
Cancel
Save