mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-04 10:41:14 +00:00
14 lines
312 B
Bash
Executable File
14 lines
312 B
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# Find all files with a given MIME type.
|
|
#
|
|
# e.g.
|
|
# $ files-with-type text/x-shellscript k8s infra
|
|
#
|
|
# Assumes `find`, `xargs`, and `file` are all installed.
|
|
|
|
mime_type=$1
|
|
shift
|
|
|
|
git ls-files "$@" | grep -vE '^vendor/' | xargs file --mime-type | grep "${mime_type}" | sed -e 's/:.*$//'
|