Shell script error handling (#628)

* fn: fortify shell scripts with euo pipefail
This commit is contained in:
Tolga Ceylan
2017-12-23 13:05:41 -08:00
committed by GitHub
parent 4b9716dbfb
commit becd7652b1
3 changed files with 4 additions and 6 deletions

View File

@@ -1,7 +1,6 @@
#!/bin/sh
#!/bin/bash
# find and output all Go files that are not correctly formatted
set -e
set -euo pipefail
# Find all .go files except those under vendor/ or .git, run gofmt -l on them
OUT=$(find ! \( -path ./vendor -prune \) ! \( -path ./.git -prune \) -name '*.go' -exec gofmt -l {} +)