#!/bin/bash export LOG_PREFIX="[fetch_code $remote @ $checkout -> $path]" log "getting the codez~ time to fetch!" git clone "$remote" "$path" if [ ! $? -eq 0 ]; then log "oh nyo! couldn't clone the repo" exit 1 fi cd "$path" log "switching to $checkout like a good kitty~" git reset --hard "$checkout" if [ ! $? -eq 0 ]; then log "ouchie! can't reset to $checkout" cd - exit 1 fi cd -