Skip to content

Instantly share code, notes, and snippets.

@natw natw/lpp_versions
Created Jun 13, 2011

Embed
What would you like to do?
#!/bin/bash
function main() {
for rpath in `repo_paths`; do
url="http://frogbucket$rpath/raw-file/tip/Gemfile.lock"
lines=`core_line`
if [[ $lines ]]; then
echo "$rpath"
echo "$lines" | while read line; do
echo -e "\t$line"
done
fi
done
}
function repo_paths() {
curl http://frogbucket/repos/ 2> /dev/null |
grep "a href" |
grep "lpp_" |
grep -v "/users" | # remove assorted undesirable lines
grep -v "<li>" |
grep -v "/rev/" |
tail -r | # reverse the order of the lines
cut -d \" -f 2 | # just the URI
grep -v "/admin/" | # remove a few more undesirable URIs
grep -v "login/?next" |
grep -v "^/$"
}
function core_line() {
curl -f $url 2> /dev/null |
grep "lpp-core " |
sed 's/^\s*//g'
}
main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.