Add option to update

This commit is contained in:
Antonio J. Delgado 2025-08-29 15:39:56 +03:00
parent 69e4de7dcf
commit 5bcd730d4b

View file

@ -1,10 +1,22 @@
#!/bin/bash
update=false
script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
if [ ! -d "${script_dir}/.venv" ]; then
python3 -m venv "$script_dir/.venv"
fi
# shellcheck disable=1091
source "$script_dir/.venv/bin/activate"
pip install -r "$script_dir/requirements.txt" > /dev/null
pip install "$script_dir/" > /dev/null
while [ "${#}" -gt 0 ]
do
case "${1}" in
'--update'|'-u')
shift
update=true
;;
esac
done
if [ "${update}" == "true" ]; then
pip install -r "$script_dir/requirements.txt" > /dev/null
pip install "$script_dir/" > /dev/null
fi
__project_codename__.py "${@}"