#!/bin/sh
# Test fixture: a fake `gh` for apps/review/tests/action.
#
# Checked in and executable (not written at test time) so spawning it never
# races a fresh write-then-exec (see tests/github/fixtures/fake-gh).
#
# Prints $SMITHERS_FAKE_GH_STDOUT and exits with $SMITHERS_FAKE_GH_EXIT
# (default 0, printing stderr on failure), so tests can script gh responses.
if [ "${SMITHERS_FAKE_GH_EXIT:-0}" -ne 0 ]; then
  printf 'fake gh failure' >&2
  exit "$SMITHERS_FAKE_GH_EXIT"
fi
printf '%s' "$SMITHERS_FAKE_GH_STDOUT"
