Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 28 lines (21 sloc) 721 Bytes
#!/bin/bash -l
set -e
NAME=$1
if [ -z $NAME ]; then
echo "Please supply a repository name."
exit 1
fi
REPO=`egrep "^$NAME\t" ~/.repositories | cut -f 2`
if [ -z $REPO ]; then
echo "No repository found: $NAME."
exit 1
fi
tmux new-window -n $NAME
tmux split-window -h
tmux split-window -v -t $NAME
tmux send-keys -t 2 " git clone $REPO $NAME" "C-m"
tmux send-keys -t 2 " cd $NAME" "C-m"
tmux send-keys -t 2 " git sw \`git last-branch | sed 's/origin\///'\`" "C-m"
tmux send-keys -t 2 " test -e ./script/bootstrap && ./script/bootstrap && test -e ./script/autotest && ./script/autotest" "C-m"
tmux send-keys -t 1 " sleep 5 && cd $NAME && $EDITOR" "C-m"
tmux send-keys -t 0 " sleep 5 && cd $NAME" "C-m"