summaryrefslogtreecommitdiff
path: root/init.sh
diff options
context:
space:
mode:
authorRasmus Andersson <rasmus@notion.se>2018-08-28 19:43:39 +0300
committerRasmus Andersson <rasmus@notion.se>2018-08-28 19:44:04 +0300
commit18ba0aee6a280ee808f9279f5f7e57315c3ee073 (patch)
treed916204cd94d7fa383278556185e19f7c99bc0dc /init.sh
parent5ecf53902eb46db2162d1428d38eb175fd743e97 (diff)
downloadinter-18ba0aee6a280ee808f9279f5f7e57315c3ee073.tar.xz
upgrade dependencies
Diffstat (limited to 'init.sh')
-rwxr-xr-xinit.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/init.sh b/init.sh
index 65c3d1ea5..eec29d161 100755
--- a/init.sh
+++ b/init.sh
@@ -80,7 +80,9 @@ else
}
# TODO: allow setting a flag to recreate venv
- # rm -rf "$VENV_DIR"
+ if $clean; then
+ rm -rf "$VENV_DIR"
+ fi
if [[ ! -d "$VENV_DIR/bin" ]]; then
echo "Setting up virtualenv in '$VENV_DIR'"
@@ -96,11 +98,13 @@ else
UPDATE_TIMESTAMP_FILE="$VENV_DIR/last-pip-run.mark"
REQUIREMENTS_FILE=$SRCDIR/requirements.txt
+ PY_REQUIREMENTS_CHANGED=false
if [ "$REQUIREMENTS_FILE" -nt "$UPDATE_TIMESTAMP_FILE" ]; then
echo "pip install -r $REQUIREMENTS_FILE"
pip install -r "$REQUIREMENTS_FILE"
date '+%s' > "$UPDATE_TIMESTAMP_FILE"
+ PY_REQUIREMENTS_CHANGED=true
fi
# ————————————————————————————————————————————————————————————————————————————————————————————————
@@ -189,7 +193,7 @@ else
DIR=$1
REF_FILE=$DIR/$2
set -e
- if $clean || [ ! -f "$REF_FILE" ] || has_newer "$DIR" "$REF_FILE"; then
+ if $clean || $PY_REQUIREMENTS_CHANGED || [ ! -f "$REF_FILE" ] || has_newer "$DIR" "$REF_FILE"; then
pushd "$DIR" >/dev/null
if $clean; then
find . \
@@ -206,6 +210,7 @@ else
python setup.py build_ext --inplace
popd >/dev/null
touch "$REF_FILE"
+ PY_REQUIREMENTS_CHANGED=true
fi
}