Skip to content

Instantly share code, notes, and snippets.

@chx
Last active September 11, 2017 18:21
Show Gist options
  • Save chx/31bd9db5c8e5e388875a401a3ef88778 to your computer and use it in GitHub Desktop.
Save chx/31bd9db5c8e5e388875a401a3ef88778 to your computer and use it in GitHub Desktop.
services-grep
ruby -ryaml -rjson -e 'puts JSON.pretty_generate(YAML.load(ARGF))' $2 | \
jq -Mr --arg name "$1" '.services | keys[] as $k | .[$k] | select(.tags[]?.name == $name) | $k'
# ag -l -G '.services.yml$' access_check| while read filename ;do services-grep access_check "$filename" ;done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment