Skip to content

Commit

Permalink
launchdev.sh: add some safety checks
Browse files Browse the repository at this point in the history
  • Loading branch information
cognifloyd committed Nov 9, 2024
1 parent 21d5147 commit e7caa23
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tools/launchdev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,17 @@ function init()
else
ST2_REPO=${CURRENT_DIR}/${COMMAND_PATH}/..
fi
ST2_REPO=$(readlink -f ${ST2_REPO})
ST2_LOGS="${ST2_REPO}/logs"
# ST2_REPO/virtualenv is the Makefile managed dir.
# The workflow should set this to use a pants exported or other venv instead.
VIRTUALENV=${VIRTUALENV_DIR:-${ST2_REPO}/virtualenv}
VIRTUALENV=$(readlink -f ${VIRTUALENV})
PY=${VIRTUALENV}/bin/python
if [ ! -f "${PY}" ]; then
eecho "${PY} does not exist"
exit 1
fi
PYTHON_VERSION=$(${PY} --version 2>&1)

echo -n "Using virtualenv: "; iecho "${VIRTUALENV}"
Expand Down Expand Up @@ -218,9 +225,9 @@ function st2start()
fi

# activate virtualenv to set PYTHONPATH
source ${VIRTUALENV}/bin/activate
source "${VIRTUALENV}/bin/activate"
# set configuration file location.
export ST2_CONFIG_PATH=${ST2_CONF};
export ST2_CONFIG_PATH="${ST2_CONF}"

# Kill existing st2 terminal multiplexor sessions
for tmux_session in $(tmux ls 2>/dev/null | awk -F: '/^st2-/ {print $1}')
Expand Down

0 comments on commit e7caa23

Please sign in to comment.