Last active
December 16, 2015 00:39
-
-
Save bakins/5349070 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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