Browse Source

Aprimorando script check_migrations.sh para executa-lo de qualquer pasta do repositório

Signed-off-by: Eliseu Egewarth <eliseuegewarth@gmail.com>
pull/1933/head
Eliseu Egewarth 8 years ago
parent
commit
9ab8d86880
  1. 9
      check_migrations.sh

9
check_migrations.sh

@ -11,13 +11,14 @@
# A chamada do django 1.10 INVERTE ISSO.
#
# https://docs.djangoproject.com/en/1.10/ref/django-admin/#cmdoption-makemigrations-check
if python manage.py makemigrations --dry-run --exit > /dev/null; then
git_project_root=$(git rev-parse --show-toplevel)
if python ${git_project_root}/manage.py makemigrations --dry-run --exit > /dev/null; then
NC='\033[0m'
RED='\033[0;31m'
echo
echo -e "${RED}ALGUMAS ALTERAÇÕES EXIGEM MIGRAÇÃO.${NC}"
echo -e "${RED}RODE 'python manage.py makemigrations' ANTES DE SUBMETER SEU CÓDIGO...${NC}"
echo -e "${RED}lembre de adicionar os arquivos criados ao git com 'git add .' ou semelhante.${NC}"
echo -e "${RED}Execute o comando 'python manage.py makemigrations' ANTES DE SUBMETER SEU CÓDIGO...${NC}"
echo -e "${RED}Lembre de adicionar os arquivos criados ao git com 'git add <arquivo>' ou semelhante.${NC}"
echo
exit 1
fi
fi

Loading…
Cancel
Save