*/lib/ruby/gems/*/gems/ -maxdepth 2 -name '*.gemspec' | sort -t/ -k7 -r | sort -u -t/ -k8 | sed -E 's/(.*)/grep -q changelog_uri \1 || echo \1/' | sh | cut -d/ -f8 | sed -E 's!([^/]+).gemspec$!curl -s -H "Authorization: '$RUBYGEMS_APIKEY'" https://rubygems.org/api/v1/gems/\1.json | jq -c "{name,project_uri,homepage_uri,source_code_uri,changelog_uri}"!' | sh | tee gems.txt $ grep '"changelog_uri":null' gems.txt >missing_changelog_uri_gems.txt $ sed -e 's/$/,/' -e '1i [' -e '$a null]' missing_changelog_uri_gems.txt >missing_changelog_uri_gems.json 後続処理のために valid な JSON に変換します。