#!/usr/bin/env sh
#
# git-peak - look at current code of repo in tmpdir

set -eu

REPO="$1"
[ -z "${REPO}" ] && exit 1

tmpdir=$(mktemp -d "${TMPDIR:-/tmp}"/"$(basename "$0")".XXXXXX) || exit 1
trap 'command rm -rf "$tmpdir"' EXIT INT TERM HUP

git clone --depth 1 "${REPO}" "${tmpdir}"
"${EDITOR:-vi}" "${tmpdir}"

# should ideally also be able to see git log (is there a simple script to grab this from github?)
# should be able to store dir to temp and remember this when run again in a few minutes
# should open the readme file automatically
