python_skeleton/skeleton/project_codename.sh

23 lines
569 B
Bash
Raw Normal View History

2024-10-03 12:19:44 +02:00
#!/bin/bash
2025-08-29 14:39:56 +02:00
update=false
2024-11-16 22:10:45 +01:00
script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
if [ ! -d "${script_dir}/.venv" ]; then
2025-05-28 14:19:27 +02:00
python3 -m venv "$script_dir/.venv"
2024-10-03 12:19:44 +02:00
fi
# shellcheck disable=1091
2024-11-16 22:10:45 +01:00
source "$script_dir/.venv/bin/activate"
2025-08-29 14:39:56 +02:00
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
2024-11-19 11:20:00 +01:00
__project_codename__.py "${@}"