#!/bin/zsh set -e trap 'echo Test failed!' ERR name=' "Example"' dir=${0%/*} root=$dir/.. tmp=$(mktemp -d) trap 'rm -rf $tmp' EXIT rsync -a --exclude-from=$root/.gitignore $root/. $tmp/ cd $tmp git clean -fxdq 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"