make 922 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/bin/bash
  2. cd "$( cd "$( dirname "$0" )"; pwd )"
  3. PROJECT_NAME="acme"
  4. export PIPENV_VERBOSITY=-1 # suppress warning if pipenv is starting inside venv
  5. function init {
  6. pip3 install pipenv --upgrade
  7. PIPENV_VENV_IN_PROJECT=1 pipenv install --dev --skip-lock
  8. }
  9. function run {
  10. FLASK_APP=$PROJECT_NAME FLASK_DEBUG=1 pipenv run flask run
  11. }
  12. function shell {
  13. init
  14. pipenv shell
  15. }
  16. function test {
  17. pipenv run py.test
  18. }
  19. function lint {
  20. pipenv run flake8 $PROJECT_NAME
  21. }
  22. function coverage {
  23. pipenv run py.test -c .coveragerc --verbose tests
  24. }
  25. function publish {
  26. pipenv run python setup.py sdist bdist_wheel
  27. # publish somewhere...
  28. rm -fr build dist .egg $PROJECT_NAME.egg-info
  29. }
  30. # -----------------------------------------------------------------------------
  31. coms=$( cat $0 | egrep "^function" | awk '{print $2}' | tr "\n" " " )
  32. if [ -z "$1" ]; then
  33. echo "Select command: $coms"
  34. exit
  35. fi
  36. $1