Browse Source

Corrige check_migrations quando fora de um commit

pull/1663/head
Marcio Mazza 7 years ago
parent
commit
fc4129c670
  1. 9
      check_migrations.sh

9
check_migrations.sh

@ -12,9 +12,12 @@ falha ()
exit 1 exit 1
} }
# deve haver alguma migration nova no commit # se há algum model no commit
if ! git diff --cached --name-status | grep -q '^A.*/migrations/[[:digit:]]\{4\}_.*\.py$'; then if git diff --cached --name-status | grep -q '^M.*models\.py$'; then
falha # deve haver alguma migration nova no commit
if ! git diff --cached --name-status | grep -q '^A.*/migrations/[[:digit:]]\{4\}_.*\.py$'; then
falha
fi
fi fi
# a verificação de migrations pendentes deve passar # a verificação de migrations pendentes deve passar

Loading…
Cancel
Save