From f2f34750acf0ac835f8d1b16277b9e2887706ccc Mon Sep 17 00:00:00 2001 From: Ethan Paul Date: Fri, 7 Nov 2025 12:33:18 -0500 Subject: [PATCH] Fix errors passing project arg through container init in dev func Fix usage of old PROJECTS_DIR env var in starship setup --- scripts.d/10-starship.sh | 2 +- scripts.d/50-dev.sh | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts.d/10-starship.sh b/scripts.d/10-starship.sh index 6040f34..d8f85df 100644 --- a/scripts.d/10-starship.sh +++ b/scripts.d/10-starship.sh @@ -1,5 +1,5 @@ function set_window_title() { - if [ "${PWD}" == "$PROJECTS_DIR/*" ]; then + if [ "${PWD}" == "$PROJECTS_PATH/*" ]; then echo -ne "\033]0; Toolbox: Development \007" else echo -ne "\033]0; $LOCATION \007" diff --git a/scripts.d/50-dev.sh b/scripts.d/50-dev.sh index 0aefd1d..17fe928 100644 --- a/scripts.d/50-dev.sh +++ b/scripts.d/50-dev.sh @@ -9,7 +9,7 @@ function dev() { fi if [ -f '/run/.toolboxenv' ]; then - cd "${PROJECTS_DIR}/${project}"; + cd "${PROJECTS_PATH}/${project}"; if [ -f "${PWD}/ansible.cfg" ]; then export ANSIBLE_CONFIG="${PWD}/ansible.cfg"; @@ -19,7 +19,7 @@ function dev() { if [ -f "${PWD}/pyproject.toml" ]; then poetry_venv=$(poetry env info --path) - if [ ! -z "${poetry_venv}" ]; then + if [ ! -z "${poetry_venv}" ] && [ -f "${poetry_venv}/bin/activate" ]; then source "${poetry_venv}/bin/activate"; fi fi @@ -40,7 +40,7 @@ function dev() { echo ">>> ${PWD}" toolbox enter "${container_name}" echo ">>> Exited: ${container_name}" - cd ${current} + cd "${current}" podman container stop "${container_name}" &>/dev/null podman container rm --force "${container_name}" &>/dev/null @@ -48,7 +48,8 @@ function dev() { } if [ -f '/run/.toolboxenv' ]; then - if [ "${PWD}" == "$PROJECTS_PATH/*" ]; then + if [[ "${PWD}" == $PROJECTS_PATH/* ]]; then dev $(basename "${PWD}") fi fi +