#!/usr/bin/env bash

files=$(git diff --name-only --cached --diff-filter=d)
length=${#files}

# Run rubocop hook only when analyzable files are present
if [[ $length -ne 0 ]]; then
  ./bin/rubocop --only-recognized-file-types $files
else
  echo "No files to analyze"
fi
