Rename pre-commit to pre-push

This commit is contained in:
Jan Tuomi
2018-01-25 22:36:38 +02:00
parent cf50050eba
commit c671206e8a
3 changed files with 6 additions and 7 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ Set up your SSH key authentication in GitLab Profile Settings. Then clone the re
git clone git@git.sahkoinsinoorikilta.fi:vtmk/web2.0.git
cd web2.0
git checkout develop
cp scripts/git/pre-commit .git/hooks/pre-commit # install a script to test code before committing
cp scripts/git/pre-push .git/hooks/pre-push # install a script to test code before committing
```
## Windows install instructions
@@ -7,13 +7,13 @@ NC='\033[0m' # No Color
if [ $? -ne 0 ]
then
printf "${PURPLE}Failed to find virtualenv. Skipping pre-commit hook.\n${NC}"
printf "${PURPLE}Failed to find virtualenv. Skipping pre-push hook.\n${NC}"
exit 0
fi
set -e
printf "${PURPLE}Running pre-commit tests.${NC}\n"
printf "${PURPLE}Running pre-push tests.${NC}\n"
printf "${PURPLE}npm tests...${NC}\n"
npm test
printf "${PURPLE}pycodestyle tests...${NC}\n"
+3 -4
View File
@@ -44,7 +44,7 @@ then
exit 0
fi
$INTERACTIVE && read -p "Copy settings from template? [y/n]" -n 1 -r || REPLY="y"
$INTERACTIVE && read -p "Copy settings from template? (recommended) [y/n]" -n 1 -r || REPLY="y"
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]
@@ -52,13 +52,12 @@ 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"
$INTERACTIVE && read -p "Copy pre-push hook to .git/hooks? (recommended) [y/n]" -n 1 -r || REPLY="y"
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]
then
cp "$PWD/scripts/git/pre-commit" "$PWD/.git/hooks/pre-commit"
sed -i "s|VIRTUALENV_ACTIVATE|$(which activate)|g" "$PWD/.git/hooks/pre-commit"
cp "$PWD/scripts/git/pre-push" "$PWD/.git/hooks/pre-push"
fi