From b20a4ddb0c0b1dee7e4f7cd21e31daf51c6bdba9 Mon Sep 17 00:00:00 2001 From: Buddy Sandidge Date: Sun, 4 Nov 2012 11:40:46 -0800 Subject: [PATCH] Add experiment-html script to make html5 boilerplate project Script will: - Start and configure tmux - Download html5 boilerplate - Make git project - Open vim - Start simple http server - Start live-reload - Start Open browser --- bin/.gitignore | 0 bin/experiment-html | 49 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) delete mode 100644 bin/.gitignore create mode 100755 bin/experiment-html diff --git a/bin/.gitignore b/bin/.gitignore deleted file mode 100644 index e69de29..0000000 diff --git a/bin/experiment-html b/bin/experiment-html new file mode 100755 index 0000000..e53cd39 --- /dev/null +++ b/bin/experiment-html @@ -0,0 +1,49 @@ +#!/usr/bin/env bash + +experiment=$1 +dir=~/experiments/$experiment + +if [[ ! -d $dir ]]; then + mkdir $dir + git clone https://github.com/h5bp/html5-boilerplate.git $dir + cd $dir + rm -rf .git + git init + git add . + git commit -m "inital commit" + cd - +fi + +tmux has-session -t $experiment +if [[ $? == 0 ]]; then + tmux attach -t $experiment + exit +fi + +tmux new-session -s $experiment -n editor -d +tmux split-window -h -t $experiment + +tmux new-window -n console -t $experiment + +tmux split-window -h -t $experiment:2 +tmux split-window -v -t $experiment:2 + +tmux send-keys -t $experiment:1.1 "cd $dir" C-m +tmux send-keys -t $experiment:1.1 "vim index.html" C-m + +tmux send-keys -t $experiment:1.2 "cd $dir" C-m +tmux send-keys -t $experiment:1.2 "git status" C-m + +tmux send-keys -t $experiment:2.1 "cd $dir" C-m +tmux send-keys -t $experiment:2.1 "python -m SimpleHTTPServer" C-m + +tmux send-keys -t $experiment:2.2 "cd $dir" C-m +tmux send-keys -t $experiment:2.2 "livereload" C-m + +tmux send-keys -t $experiment:2.3 "cd $dir" C-m +tmux send-keys -t $experiment:2.3 "sleep 2" C-m +tmux send-keys -t $experiment:2.3 "chromium-browser http://localhost:8000 &" C-m + +tmux select-window -t $experiment:1 +tmux attach -t $experiment +