mirror of
https://github.com/mandiant/capa.git
synced 2025-12-23 15:37:37 -08:00
Update setup-hooks.sh
This commit is contained in:
@@ -1,4 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -u
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
GIT_DIR=`git rev-parse --show-toplevel`
|
GIT_DIR=`git rev-parse --show-toplevel`
|
||||||
cd $GIT_DIR
|
cd $GIT_DIR
|
||||||
@@ -8,9 +12,9 @@ cd $GIT_DIR
|
|||||||
# After that append `scripts/hooks/$arg` and ensure they can be run
|
# After that append `scripts/hooks/$arg` and ensure they can be run
|
||||||
create_hook() {
|
create_hook() {
|
||||||
if [[ ! -e .git/hooks/$1 ]]; then
|
if [[ ! -e .git/hooks/$1 ]]; then
|
||||||
echo '#!/bin/sh' > .git/hooks/$1
|
echo "#!/bin/sh" > ".git/hooks/$1"
|
||||||
fi
|
fi
|
||||||
cat scripts/hooks/$1 >> .git/hooks/$1
|
cat scripts/hooks/$1 >> ".git/hooks/$1"
|
||||||
chmod +x .git/hooks/$1
|
chmod +x .git/hooks/$1
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -19,7 +23,6 @@ create_hook 'post-commit'
|
|||||||
create_hook 'pre-push'
|
create_hook 'pre-push'
|
||||||
|
|
||||||
echo '\n#### Installing linter/test dependencies\n'
|
echo '\n#### Installing linter/test dependencies\n'
|
||||||
pip install pycodestyle
|
pip install pycodestyle pytest-sugar
|
||||||
pytest-sugar
|
|
||||||
pip install https://github.com/williballenthin/vivisect/zipball/master
|
pip install https://github.com/williballenthin/vivisect/zipball/master
|
||||||
python setup.py develop
|
python setup.py develop
|
||||||
|
|||||||
Reference in New Issue
Block a user