From 99193d0e3a36c3c8bc7185068b557aa593d5cea2 Mon Sep 17 00:00:00 2001 From: Sheldon Els Date: Mon, 31 Aug 2015 22:37:56 +0200 Subject: [PATCH] describe without ruby no dependency on ruby & a little quicker. all credit to @derekstavis for the cool regexs --- pkg/omf/cli/omf.describe.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/omf/cli/omf.describe.fish b/pkg/omf/cli/omf.describe.fish index 6c2ff26..7ec9871 100644 --- a/pkg/omf/cli/omf.describe.fish +++ b/pkg/omf/cli/omf.describe.fish @@ -8,7 +8,7 @@ function omf.describe -a name if test -e $package_path set url (cat $package_path) 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 echo (omf::err)"$name is not a valid pkg."(omf::off) 1^&2 return $OMF_INVALID_ARG