Skip to content

Commit

Permalink
Improve script
Browse files Browse the repository at this point in the history
  • Loading branch information
SeaDve committed Apr 15, 2022
1 parent 667a3bd commit 4b78260
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions hooks/pre-commit.hook
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@ RUNNING=" ${BOLD_GREEN}RUNNING${ENDC}"
CREATING=" ${BOLD_GREEN}CREATING${ENDC}"
ABORTING=" ${BOLD_RED}ABORTING${ENDC}"

SCRIPT=$(curl https://raw.githubusercontent.com/SeaDve/scripts/main/checks.py)
script=$(curl https://raw.githubusercontent.com/SeaDve/scripts/main/checks.py)

if [ $? -ne 0 ]
then
echo -e "${ABORTING} commit. Needs internet connection to download check script. To ignore, rerun commit with '--no-verify'"
echo
echo -e "${ABORTING} commit. Needs internet connection to download the check script. To ignore, rerun commit with '--no-verify'"
exit 1
fi

echo "$SCRIPT" | python -
printf '%s' "$script" | python -

if [ $? -eq 0 ]
if [ $? -ne 0 ]
then
echo -e "${CREATING} commit"
echo
exit 0
else
echo -e "${ABORTING} commit, please fix the above issues. To ignore, rerun commit with '--no-verify'"
echo
exit 1
fi

echo
echo -e "${CREATING} commit"
exit 0

0 comments on commit 4b78260

Please sign in to comment.