Created
December 30, 2014 06:59
-
-
Save mainej/1a4d61a92234c5cebeab to your computer and use it in GitHub Desktop.
Re-generate license_finder reports in rake task or pre-commit hook
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 | |
HTML_REPORT=doc/dependencies.html | |
STATUS_REPORT=doc/dependencies.csv | |
checksum_before=$(md5 -q < $STATUS_REPORT) | |
checksum_after=$(license_finder report --format csv --columns approved name version licenses | tee $STATUS_REPORT | md5 -q) | |
# # Alternatively | |
# CHECKSUM_FILE=doc/dependencies_status.md5 | |
# checksum_before=$(cat $CHECKSUM_FILE) | |
# checksum_after=$(license_finder report --format csv --columns approved name version licenses | md5 -q | tee $CHECKSUM_FILE) | |
if [ "$checksum_before" != "$checksum_after" ] | |
then | |
license_finder report --format html > $HTML_REPORT; | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Maybe we should provide something like this as a supported rake task in, e.g.,
lib/license_finder/rake_tasks.rb
?