Skip to content

Commit

Permalink
Enhancements to build_dependencies.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
alexioannides committed Feb 19, 2019
1 parent 1a18136 commit 6175a79
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions build_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@
# check to see if pipenv is installed
if [ -x "$(which pipenv)" ]
then
# check that there Pipfile exists in root directory
if [ ! -e Pipfile ]
# check that Pipfile.lock exists in root directory
if [ ! -e Pipfile.lock ]
then
echo 'ERROR - cannot find Pipfile'
echo 'ERROR - cannot find Pipfile.lock'
exit 1
fi

# use Pipenv to create a requirement.txt file
echo '... creating requirements.txt from Pipfile'
echo '... creating requirements.txt from Pipfile.lock'
pipenv lock -r > requirements.txt

# install packages to a temporary directory and zip it
touch requirements.txt # safeguard in case there are no packages
pip3 install -r requirements.txt --target ./packages

# check to see if there are any external dependencies
# if not then create an empty file to see zip with
# if not then create an empty file to seed zip with
if [ -z "$(ls -A packages)" ]
then
touch packages/empty.txt
Expand Down Expand Up @@ -46,6 +47,6 @@ then

exit 0
else
echo 'ERROR - pipenv is not installed --> run pip3 install pipenv to load pipenv into global site packages or install via a system package manager.'
echo 'ERROR - pipenv is not installed --> run `pip3 install pipenv` to load pipenv into global site packages or install via a system package manager.'
exit 1
fi
Binary file modified packages.zip
Binary file not shown.

0 comments on commit 6175a79

Please sign in to comment.