err() {
  print "$1" >&2
  exit 1
}

# run a command that should never fail. if the command fails execution
# will immediately terminate with an error showing the failing command.
ensure() {
  if ! "$@"; then err "command failed: $*"; fi
}
