From c671206e8ae6d1c1cb673f62db449484eaa70e6a Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Thu, 25 Jan 2018 22:36:38 +0200 Subject: [PATCH] Rename pre-commit to pre-push --- readme.md | 2 +- scripts/git/{pre-commit => pre-push} | 4 ++-- setup.sh | 7 +++---- 3 files changed, 6 insertions(+), 7 deletions(-) rename scripts/git/{pre-commit => pre-push} (72%) diff --git a/readme.md b/readme.md index 2bdb05a..808fdf9 100644 --- a/readme.md +++ b/readme.md @@ -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 diff --git a/scripts/git/pre-commit b/scripts/git/pre-push similarity index 72% rename from scripts/git/pre-commit rename to scripts/git/pre-push index 1cc7067..45fc43c 100755 --- a/scripts/git/pre-commit +++ b/scripts/git/pre-push @@ -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" diff --git a/setup.sh b/setup.sh index 3ef690d..f97b9b5 100755 --- a/setup.sh +++ b/setup.sh @@ -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