Skip to content

Instantly share code, notes, and snippets.

@camilonova
Created May 10, 2013 18:40
Show Gist options
  • Save camilonova/5556473 to your computer and use it in GitHub Desktop.
Save camilonova/5556473 to your computer and use it in GitHub Desktop.
Update requirements if they have changed
#!/bin/bash
# This script will update the requirements only if the file has changed
# Author: AxiaCore S.A.S. http://axiacore.com
FILE=.requirements_timestamp
if [ ! -f $FILE ] || [ ! `stat --format="%Y" requirements.txt` -eq $(cat $FILE) ];
then
echo "Updating requirements..."
pip install -U -r requirements.txt
stat --format="%Y" requirements.txt > $FILE
echo "Done"
else
echo "Requirements not changed."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment