Small fixes to utility scripts (#536)

* Fix python install utility when not using Heroku

Don't try to install `requirements.txt` which doesn't exist unless using Heroku.

* Fix bad absolute paths

* Allow dependency installation from any location
This commit is contained in:
Simón Castillo 2016-05-01 00:56:33 -04:30 committed by Daniel Roy Greenfeld
parent b6bf40e973
commit d7c8531e25
2 changed files with 10 additions and 4 deletions

View File

@ -1,6 +1,7 @@
#!/bin/bash
OS_REQUIREMENTS_FILENAME="requirements.apt"
WORK_DIR="$(dirname "$0")"
OS_REQUIREMENTS_FILENAME="$WORK_DIR/requirements.apt"
# Handle call with wrong command
function wrong_command()

View File

@ -1,5 +1,8 @@
#!/bin/bash
WORK_DIR="$(dirname "$0")"
PROJECT_DIR="$(dirname "$WORK_DIR")"
pip --version >/dev/null 2>&1 || {
echo >&2 -e "\npip is required but it's not installed."
echo >&2 -e "You can install it by running the following command:\n"
@ -43,8 +46,10 @@ if [ -z "$VIRTUAL_ENV" ]; then
exit 1;
else
pip install -r requirements/local.txt
pip install -r requirements/test.txt
pip install -r requirements.txt
pip install -r $PROJECT_DIR/requirements/local.txt
pip install -r $PROJECT_DIR/requirements/test.txt
{% if cookiecutter.use_heroku == "y" -%}
pip install -r $PROJECT_DIR/requirements.txt
{%- endif %}
fi