1#!/bin/sh23if ! command -v ormolu 1>/dev/null; then4 echo "error: ormolu is not installed" 1>&25 exit 16fi78# TODO: Add an option to ormolu to only print file names.9files=$(git diff --diff-filter=MA --cached --name-only | \10 awk '/..*\.hs/' | \11 xargs -r ormolu --mode check 2>&1 | \12 awk '/[a-zA-Z.\/][a-zA-Z.\/]*\.hs/')1314if [ -n "${files}" ]; then15 printf "The following files need to be formated with 'ormolu':\n\n" 1>&216 printf "%s\n" "${files}" | sed 's/^/\t/' 1>&217 exit 118fi