#!/bin/bash
. "$(dirname "$0")/_/husky.sh"

PARENT_DIR="$(git rev-parse --show-toplevel)"
SCAFFOLD_PATH=$(grep hooksPath "${PARENT_DIR}"/.git/config | awk '{print $3}')

if [ ! -z "${SCAFFOLD_PATH}" ]; then
  cd "${PARENT_DIR}/${SCAFFOLD_PATH}/.."
fi
npx lint-staged
