diff --git a/files-with-type b/files-with-type index 0c7dcbb092..8238980c69 100755 --- a/files-with-type +++ b/files-with-type @@ -4,10 +4,8 @@ # # 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/:.*$//' +git ls-files "$@" | grep -vE '^vendor/' | xargs file --mime-type | grep "${mime_type}" | sed -e 's/:.*$//' diff --git a/lint b/lint index eeca6653f7..994d4c3217 100755 --- a/lint +++ b/lint @@ -166,7 +166,7 @@ function lint_files { function list_files { if [ $# -gt 0 ]; then - git ls-files --exclude-standard | grep -v '^vendor/' + git ls-files --exclude-standard | grep -vE '(^|/)vendor/' else git diff --cached --name-only fi