Add pre-commit hook
This commit is contained in:
Executable
+4
@@ -0,0 +1,4 @@
|
||||
set -e
|
||||
npm test
|
||||
python manage.py test
|
||||
set +e
|
||||
@@ -3,7 +3,7 @@
|
||||
echo "SIK WEB 2.0"
|
||||
echo "This script will set up the environment for this project."
|
||||
echo "========================================================="
|
||||
echo "Dependencies: postgresql>9.5, python>3.5"
|
||||
echo "Dependencies: python>3.5"
|
||||
|
||||
INTERACTIVE="true"
|
||||
USE_NPM="true"
|
||||
@@ -27,7 +27,7 @@ then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
$INTERACTIVE && read -p "Create user 'sik' in postgres (needs sudo) [y/n]?" -n 1 -r || REPLY="n"
|
||||
$INTERACTIVE && read -p "Create user 'sik' in database (needs sudo) [y/n]?" -n 1 -r || REPLY="n"
|
||||
echo ""
|
||||
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]
|
||||
@@ -52,6 +52,14 @@ then
|
||||
cp "$PWD/sikweb/settings-sample.py" "$PWD/sikweb/settings.py"
|
||||
fi
|
||||
|
||||
$INTERACTIVE && read -p "Copy pre-commit hook to .git/hooks? [y/n]" -n 1 -r || REPLY="y"
|
||||
echo ""
|
||||
|
||||
if [[ $REPLY =~ ^[Yy]$ ]]
|
||||
then
|
||||
cp "$PWD/scripts/git/pre-commit" "$PWD/.git/hooks/pre-commit"
|
||||
fi
|
||||
|
||||
|
||||
$INTERACTIVE && read -p "Start setup? [y/n]" -n 1 -r || REPLY="y"
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user