Skip to content

Commit

Permalink
improve pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
submarcos committed Jan 25, 2023
1 parent b638b30 commit bbe5f51
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
#!/bin/bash

if ! command -v docker-compose &> /dev/null
then
echo "toto";
alias docker-compose="docker compose"
fi
function dockercompose {
# use docker-compose then fallback to new docker compose
docker-compose "$@"
docker compose "$@"
}

echo "run Flake8"
echo "run Flake8..."

docker-compose run -T --rm web flake8 geotrek
dockercompose run -T --rm web flake8 geotrek
status=$?

if test $status -eq 1
then
exit $status
else
echo "Flake8 check is ok..."
fi

0 comments on commit bbe5f51

Please sign in to comment.