#!/usr/bin/env sh
#MISE description="Lint shell files"
#MISE alias=["l:sh", "l:shell", "lint:sh"]

set -e

find bin -type f -exec sh -c '
  for file; do
    if head -n 1 "$file" 2>/dev/null | grep -qE "^#!.*(sh|bash)"; then
      shellcheck "$file"
    fi
  done
' sh {} +
