| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | |
| 3 | if [scip-shell system . . `[`. -z "$1" ]; then |
| 4 | rmscip-shell system . . rm. -f ./gofmterr |
| 5 | findscip-shell system . . find. . -iname '*.go' ! -name '*.pb.go' -exec "$0" {} \; |
| 6 | [scip-shell system . . `[`. -f ./gofmterr ] && exit 1 |
| 7 | exit 0 |
| 8 | fi |
| 9 | |
| 10 | OUT="$(./goimports -d "$1" | awkscip-shell system . . awk. '{printf "%s%%0A",$0}')" |
| 11 | if [scip-shell system . . `[`. -n "$OUT" ]; then |
| 12 | echoscip-shell system . . echo. "::error file=$1::$OUT" |
| 13 | touchscip-shell system . . touch. ./gofmterr |
| 14 | fi |