Skip to content

Commit

Permalink
Merge pull request #11 from 26B/fix/hook-file-path
Browse files Browse the repository at this point in the history
  • Loading branch information
goncaloasimoes authored Aug 11, 2022
2 parents b5a1622 + 94f62dc commit a253fb1
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions php-pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@ then
fi

# Determine bin directory using composer ^2.2.2 global.
if [[ -z "$COMPOSER_BIN_DIR" ]]; then
BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
if [[ -z "$COMPOSER_RUNTIME_BIN_DIR" ]]; then
HOOK_FILE_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/pre-commit"
else
BIN_DIR="$COMPOSER_BIN_DIR"
HOOK_FILE_PATH="$COMPOSER_RUNTIME_BIN_DIR/../26b/php-pre-commit/pre-commit"
fi

HOOK_FILE_PATH="${BIN_DIR}/../26b/php-pre-commit/pre-commit"

# Check if hook file exists before copying.
if test -z "$HOOK_FILE_PATH"
then
Expand Down

0 comments on commit a253fb1

Please sign in to comment.