Commit 99193d0e authored by Sheldon Els's avatar Sheldon Els

describe without ruby

no dependency on ruby & a little quicker. all credit to @derekstavis for the
cool regexs
parent 0a32588f
...@@ -8,7 +8,7 @@ function omf.describe -a name ...@@ -8,7 +8,7 @@ function omf.describe -a name
if test -e $package_path if test -e $package_path
set url (cat $package_path) set url (cat $package_path)
set repo (basename (dirname $url))/(basename $url) set repo (basename (dirname $url))/(basename $url)
curl -s https://api.github.com/repos/$repo | ruby -rjson -e 'j = JSON.parse(ARGF.read); puts j["description"]' curl -s https://api.github.com/repos/$repo 2>/dev/null | grep \"description\" | head -1 | cut -d':' -f2- | sed -e 's/["|,]//g;s/^[ \t]//g'
else else
echo (omf::err)"$name is not a valid pkg."(omf::off) 1^&2 echo (omf::err)"$name is not a valid pkg."(omf::off) 1^&2
return $OMF_INVALID_ARG return $OMF_INVALID_ARG
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment