github.com/npaton/distribution@v2.3.1-rc.0+incompatible/project/hooks/configure-hooks.sh (about)

     1  #!/bin/sh
     2  
     3  cd $(dirname $0)
     4  
     5  REPO_ROOT=$(git rev-parse --show-toplevel)
     6  RESOLVE_REPO_ROOT_STATUS=$?
     7  if [ "$RESOLVE_REPO_ROOT_STATUS" -ne "0" ]; then
     8  	echo -e "Unable to resolve repository root. Error:\n$REPO_ROOT" > /dev/stderr
     9  	exit $RESOLVE_REPO_ROOT_STATUS
    10  fi
    11  
    12  set -e
    13  set -x
    14  
    15  # Just in case the directory doesn't exist
    16  mkdir -p $REPO_ROOT/.git/hooks
    17  
    18  ln -f -s $(pwd)/pre-commit $REPO_ROOT/.git/hooks/pre-commit