github.com/weaveworks/common@v0.0.0-20230728070032-dd9e68f319d5/tools/files-with-type (about)

     1  #!/usr/bin/env bash
     2  #
     3  # Find all files with a given MIME type.
     4  #
     5  # e.g.
     6  #     $ files-with-type text/x-shellscript k8s infra
     7  
     8  mime_type=$1
     9  shift
    10  
    11  git ls-files "$@" | grep -vE '^vendor/' | xargs file --mime-type | grep "${mime_type}" | sed -e 's/:.*$//'