#!/bin/zsh set -e trap 'echo Test failed!' ERR name=' "Example"' root=$(realpath ${0%/*}/..) tmp=$(mktemp -d) trap 'rm -rf $tmp' EXIT cd $tmp git -C $root archive HEAD | tar -x echo "Initializing in $tmp" ./init.sh $name echo "Starting the shell in $tmp" echo "Review the files, then exit the shell" ${SHELL:-/bin/sh} -i echo "Review successful, cleaning up"