Skip to content

Commit

Permalink
Use ruby instead of sed
Browse files Browse the repository at this point in the history
  • Loading branch information
mvidner committed Dec 14, 2017
1 parent c0032fc commit 7a3b1bb
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions y2m
Expand Up @@ -220,9 +220,7 @@ get_repos_page() # {{{
(HTTP/*\ 304\ *) return 2 ;;
(*) return 22 ;;
esac
# find the "name" properties, except in the "license" subobject
sed -n -e '/"license": {/,/}/d;/"name":/s/^.*"name": "\([^"]*\)",.*$/\1/p' $responsefile \
| sort \
ruby -rjson -e 'JSON.load(ARGF).map{|r| r["name"]}.sort.each{|n| puts n}' $responsefile \
> $reposfile.tmp
local rcnt=$(wc -l < $reposfile.tmp)
mv $reposfile.tmp $reposfile
Expand Down

0 comments on commit 7a3b1bb

Please sign in to comment.