From 5bcd730d4bf6acaf9d6a14da7955ff3b50c82bfc Mon Sep 17 00:00:00 2001 From: "Antonio J. Delgado" Date: Fri, 29 Aug 2025 15:39:56 +0300 Subject: [PATCH] Add option to update --- skeleton/project_codename.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/skeleton/project_codename.sh b/skeleton/project_codename.sh index b577a4e..7957a98 100755 --- a/skeleton/project_codename.sh +++ b/skeleton/project_codename.sh @@ -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 "${@}"