Skip to content

Instantly share code, notes, and snippets.

@bakins
Last active December 16, 2015 00:39
Show Gist options
  • Save bakins/5349070 to your computer and use it in GitHub Desktop.
Save bakins/5349070 to your computer and use it in GitHub Desktop.
#!/bin/bash
FILE=Rockfile
WALL=$(printf "%s/.wall" $(pwd))
TEMP=$(printf "%s/.tmp" $(pwd))
function rock_git() {
mkdir -p $TEMP
DIR=$(basename $1 .git)
pushd $TEMP
git clone $1
pushd $DIR
if [ -n "$2" ]; then
git checkout $2
else
git checkout master
fi
SPEC=$(ls *.rockspec | sort | tail -n 1)
luarocks --tree=$WALL make $SPEC
popd
popd
}
function rock() {
if [ $1 == 'git' ]; then
rock_git $2 $3
else
luarocks --tree=$WALL install $1 $2
fi
}
. $FILE
rock https://raw.github.com/Neopallium/lua-pb/master/lua-pb-scm-0.rockspec
rock git https://github.com/bakins/lua-resty-riak refactor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment