Add option to update
This commit is contained in:
parent
69e4de7dcf
commit
5bcd730d4b
1 changed files with 14 additions and 2 deletions
|
@ -1,10 +1,22 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
update=false
|
||||||
script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||||
if [ ! -d "${script_dir}/.venv" ]; then
|
if [ ! -d "${script_dir}/.venv" ]; then
|
||||||
python3 -m venv "$script_dir/.venv"
|
python3 -m venv "$script_dir/.venv"
|
||||||
fi
|
fi
|
||||||
# shellcheck disable=1091
|
# shellcheck disable=1091
|
||||||
source "$script_dir/.venv/bin/activate"
|
source "$script_dir/.venv/bin/activate"
|
||||||
|
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 -r "$script_dir/requirements.txt" > /dev/null
|
||||||
pip install "$script_dir/" > /dev/null
|
pip install "$script_dir/" > /dev/null
|
||||||
|
fi
|
||||||
__project_codename__.py "${@}"
|
__project_codename__.py "${@}"
|
||||||
|
|
Loading…
Reference in a new issue