variant: improve error handling in shell scripts

* Add exit handlers to the shell scripts so that if something fails,
we don't leave the repo in a half-committed state.
* Add `set -e` once instead of `|| exit 1` everywhere.
* Bump version numbers in scripts.

TEST=See detailed test steps in testdata/

Change-Id: Ic038c2cf9e0cd9398bc89edfad8aee96e6669c36
Tested-by: Paul Fagerburg <>
Reviewed-by: Jack Rosenthal <>
Commit-Queue: Paul Fagerburg <>
7 files changed