#!/bin/sh -e
#
# maybe-git - echo git root if in a git repo, otherwise exit 1

# git_root="."

if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
  git_root="$(git rev-parse --show-toplevel)"
  printf '%s\n' "${git_root}"
  exit 0
fi
exit 1
