#!/usr/bin/env bash
#0 exit if not OSX
if [ "$(uname -s)" != "Darwin" ]; then
echo "Expected you are using OSX, but it's not. Stop"
exit 1
fi
#1. install pre-requisites
brew install libtermkey curl lua
#2. build & install vis
git clone https://github.com/martanne/vis.git
cd vis
#3. to be under control of homebrew
./configure --prefix=/usr/local/Cellar/vis/0.2
make && make install
brew link vis
#4. install LPeg module
luarocks install lpeg
#5. copy configuration
mkdir -p ~/.config/vis
cp /usr/local/Cellar/vis/0.2/share/vis/visrc.lua ~/.config/vis/
#6. launch
/usr/local/bin/vis