From 95b3b129ecd57297ad41b5e3dc5c7aa08abfe8ac Mon Sep 17 00:00:00 2001 From: Moritz Date: Wed, 24 Jun 2020 14:29:50 +0200 Subject: [PATCH] Update setup-hooks.sh --- scripts/setup-hooks.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/setup-hooks.sh b/scripts/setup-hooks.sh index 924a35c2..941e0e58 100755 --- a/scripts/setup-hooks.sh +++ b/scripts/setup-hooks.sh @@ -1,4 +1,8 @@ -#!/bin/sh +#!/usr/bin/env bash + +set -e +set -u +set -o pipefail GIT_DIR=`git rev-parse --show-toplevel` cd $GIT_DIR @@ -8,9 +12,9 @@ cd $GIT_DIR # After that append `scripts/hooks/$arg` and ensure they can be run create_hook() { if [[ ! -e .git/hooks/$1 ]]; then - echo '#!/bin/sh' > .git/hooks/$1 + echo "#!/bin/sh" > ".git/hooks/$1" fi - cat scripts/hooks/$1 >> .git/hooks/$1 + cat scripts/hooks/$1 >> ".git/hooks/$1" chmod +x .git/hooks/$1 } @@ -19,7 +23,6 @@ create_hook 'post-commit' create_hook 'pre-push' echo '\n#### Installing linter/test dependencies\n' -pip install pycodestyle -pytest-sugar +pip install pycodestyle pytest-sugar pip install https://github.com/williballenthin/vivisect/zipball/master python setup.py develop