From a5325afa2d73ca71d71ac0da47a058cb58ea6adf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Goran=20Meki=C4=87?= Date: Fri, 13 Mar 2020 16:50:03 +0100 Subject: [PATCH] Add support for SYSPKG --- bin/common.sh | 23 +++++++++++--------- bin/devel.sh | 10 +++++---- bin/init.sh | 2 +- freenit/project/bin/{collect.sh => build.sh} | 0 4 files changed, 20 insertions(+), 15 deletions(-) rename freenit/project/bin/{collect.sh => build.sh} (100%) diff --git a/bin/common.sh b/bin/common.sh index 5a8c862..1b81ffa 100644 --- a/bin/common.sh +++ b/bin/common.sh @@ -7,20 +7,23 @@ export PROJECT_ROOT="${BIN_DIR}/.." export VIRTUALENV=${VIRTUALENV:="${app_name}back"} export FLASK_ENV=${FLASK_ENV:="production"} export PY_VERSION=${PY_VERSION:="3.7"} +export SYSPKG=${SYSPKG:="no"} setup() { - update=${1} - if [ ! -d ${HOME}/.virtualenvs/${VIRTUALENV} ]; then - python${PY_VERSION} -m venv "${HOME}/.virtualenvs/${VIRTUALENV}" - fi - . ${HOME}/.virtualenvs/${VIRTUALENV}/bin/activate + if [ "${SYSPKG}" = "no" ]; then + update=${1} + if [ ! -d ${HOME}/.virtualenvs/${VIRTUALENV} ]; then + python${PY_VERSION} -m venv "${HOME}/.virtualenvs/${VIRTUALENV}" + fi + . ${HOME}/.virtualenvs/${VIRTUALENV}/bin/activate - cd ${PROJECT_ROOT} - if [ "${update}" != "no" ]; then - pip install -U pip - pip install -U wheel - pip install -e . + cd ${PROJECT_ROOT} + if [ "${update}" != "no" ]; then + pip install -U pip + pip install -U wheel + pip install -e . + fi fi if [ -e "${BIN_DIR}/../migrations/main/001_initial.py" ]; then flask migration run diff --git a/bin/devel.sh b/bin/devel.sh index d50b085..21124d2 100755 --- a/bin/devel.sh +++ b/bin/devel.sh @@ -4,15 +4,17 @@ BIN_DIR=`dirname $0` export FLASK_PORT=${FLASK_PORT:=5000} export FLASK_ENV="development" -export OFFLINE=${OFFLINE:=no} +export OFFLINE=${OFFLINE:="no"} +export SYSPKG=${SYSPKG:="no"} . ${BIN_DIR}/common.sh setup no - -if [ "${OFFLINE}" != "yes" ]; then - pip install -U -r requirements_dev.txt +if [ "${SYSPKG}" = "no" ]; then + if [ "${OFFLINE}" != "yes" ]; then + pip install -U -r requirements_dev.txt + fi fi diff --git a/bin/init.sh b/bin/init.sh index 076228a..139af1a 100755 --- a/bin/init.sh +++ b/bin/init.sh @@ -1,7 +1,7 @@ #!/bin/sh -export OFFLINE=${OFFLINE:=no} +export OFFLINE=${OFFLINE:="no"} BIN_DIR=`dirname $0` . ${BIN_DIR}/common.sh diff --git a/freenit/project/bin/collect.sh b/freenit/project/bin/build.sh similarity index 100% rename from freenit/project/bin/collect.sh rename to freenit/project/bin/build.sh