Skip to content

Instantly share code, notes, and snippets.

@bdjnk
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bdjnk/464e69997d0c1516c162 to your computer and use it in GitHub Desktop.
Save bdjnk/464e69997d0c1516c162 to your computer and use it in GitHub Desktop.
LuaRocks Update Check Shell Script
#!/bin/bash
cmd='luarocks-5.1'
all=`$cmd search --all`
rocks=`$cmd list | grep '^\w\S*$'`
IFS=$'\n'
for rock in $rocks
do
local_version=`$cmd list $rock | grep -A1 "^${rock}$" | grep -oE '^[\t ]+.+\-[0-9]+ '`
remote_version=`echo "$all" | grep -A1 "^${rock}$" | grep -oE '^[\t ]+.+\-[0-9]+ '`
if [ "$local_version" != "$remote_version" ]
then
echo "$rock : $local_version -> $remote_version"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment