Skip to content

Instantly share code, notes, and snippets.

@max-lobur
Created November 9, 2015 11:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save max-lobur/009946a0b15988f1a326 to your computer and use it in GitHub Desktop.
Save max-lobur/009946a0b15988f1a326 to your computer and use it in GitHub Desktop.
Utils
#!/bin/sh
if [ -z "$1" ]; then echo NEED PATH TO requirements.txt; exit; fi
while read dependency; do
dependency_stripped="$(echo "${dependency}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"
# Skip comments
if [[ $dependency_stripped == \#* ]]; then
continue
# Skip blank lines
elif [ -z "$dependency_stripped" ]; then
continue
else
echo "################### Installing $dependency_stripped ###################"
if pip install "$dependency_stripped"; then
echo "$dependency_stripped is installed"
else
echo "Could not install $dependency_stripped, skipping"
fi
fi
done < $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment