Skip to content

Commit

Permalink
Update pre-commit
Browse files Browse the repository at this point in the history
also allow for spaces in the path in the pre-commit hook
  • Loading branch information
dustinrue authored Apr 13, 2023
1 parent 8cc5d37 commit 3770319
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#!/bin/bash
. "$(dirname "$0")/_/husky.sh"

PARENT_DIR=$(git rev-parse --show-toplevel)
SCAFFOLD_PATH=$(grep hooksPath ${PARENT_DIR}/.git/config | awk '{print $3}')
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}/..
cd "${PARENT_DIR}/${SCAFFOLD_PATH}/.."
fi

npx lint-staged

0 comments on commit 3770319

Please sign in to comment.