sync-poetry 474 B

123456789101112131415161718
  1. #!/bin/bash
  2. # rely on `poetry` in path
  3. if ! command -v poetry &> /dev/null; then
  4. echo "Installing Poetry ..."
  5. pip install poetry
  6. fi
  7. # check poetry.lock in sync with pyproject.toml
  8. poetry check -C api --lock
  9. if [ $? -ne 0 ]; then
  10. # update poetry.lock
  11. # refreshing lockfile only without updating locked versions
  12. echo "poetry.lock is outdated, refreshing without updating locked versions ..."
  13. poetry lock -C api
  14. else
  15. echo "poetry.lock is ready."
  16. fi