Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Strip out comments/whitespace/etc. from requirements.txt
#!/bin/bash
# Strip out comments/whitespace/etc. from requirements.txt
if [ -z "$1" ]
then
echo "Missing input requirements.txt dep!"
exit 1
fi
# Specifics:
#
# $ for empty lines
# \s for lines starting w/ white space
# # for lines starting w/ comments
# git+git:// for git-related dependencies
egrep -v "^($|\s|#|(git\+git://))" $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.