Last active
October 11, 2023 07:30
-
-
Save loisaidasam/d388d7b6a4049a886da51863e37da9ca to your computer and use it in GitHub Desktop.
Strip out comments/whitespace/etc. from requirements.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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