#!/usr/bin/with-contenv bash

# This is an install script that is designed to run after init-mods-package-install
# so it can take advantage of packages installed
# init-mods-end depends on this script so that later init and services wait until this script exits

echo "**** Setting up poetry ****"

# Install poetry
curl -sSL https://install.python-poetry.org | python3 -

# Add poetry to the path
echo "**** ensuring poetry is in PATH ****"
if ! grep -q "$HOME/.local/bin" /var/run/s6/container_environment/PATH; then
    printf ':$HOME/.local/bin' >> /var/run/s6/container_environment/PATH
fi

echo "**** poetry setup complete ****"