2024-06-14 20:54:07 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# rely on `poetry` in path
|
|
|
|
if ! command -v poetry &> /dev/null; then
|
|
|
|
echo "Installing Poetry ..."
|
|
|
|
pip install poetry
|
|
|
|
fi
|
|
|
|
|
|
|
|
# check poetry.lock in sync with pyproject.toml
|
|
|
|
poetry check -C api --lock
|
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
# update poetry.lock
|
|
|
|
# refreshing lockfile only without updating locked versions
|
2024-10-08 15:11:45 +08:00
|
|
|
echo "poetry.lock is outdated, refreshing without updating locked versions ..."
|
2024-06-14 20:54:07 +08:00
|
|
|
poetry lock -C api --no-update
|
2024-10-08 15:11:45 +08:00
|
|
|
else
|
|
|
|
echo "poetry.lock is ready."
|
2024-06-14 20:54:07 +08:00
|
|
|
fi
|