vet: use fail_on_output so user can see why git client is not porcelain (#2605)
This commit is contained in:
12
vet.sh
12
vet.sh
@ -13,10 +13,12 @@ die() {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fail_on_output() {
|
||||||
|
tee /dev/stderr | (! read)
|
||||||
|
}
|
||||||
|
|
||||||
# Check to make sure it's safe to modify the user's git repo.
|
# Check to make sure it's safe to modify the user's git repo.
|
||||||
if git status --porcelain | read; then
|
git status --porcelain | fail_on_output
|
||||||
die "Uncommitted or untracked files found; commit changes first"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Undo any edits made by this script.
|
# Undo any edits made by this script.
|
||||||
cleanup() {
|
cleanup() {
|
||||||
@ -24,10 +26,6 @@ cleanup() {
|
|||||||
}
|
}
|
||||||
trap cleanup EXIT
|
trap cleanup EXIT
|
||||||
|
|
||||||
fail_on_output() {
|
|
||||||
tee /dev/stderr | (! read)
|
|
||||||
}
|
|
||||||
|
|
||||||
PATH="${GOPATH}/bin:${GOROOT}/bin:${PATH}"
|
PATH="${GOPATH}/bin:${GOROOT}/bin:${PATH}"
|
||||||
|
|
||||||
if [[ "$1" = "-install" ]]; then
|
if [[ "$1" = "-install" ]]; then
|
||||||
|
Reference in New Issue
Block a user