This repository has been archived by the owner on Oct 22, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c49ee35
commit 1190a4f
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bash | ||
# Check if the documentation in the man directory matches what should be in it | ||
# based on what is in the headers of the R scripts. | ||
echo "Starting documentation check." | ||
|
||
# Concatenate all the files in the man dir into one long string and md5sum it. | ||
orig_sum=$(find man -type f | sort -u | xargs cat | md5sum) | ||
|
||
# Rebuild the documentation. | ||
R -e "devtools::document()" | ||
|
||
# Concatenate all the files in the man dir into one long string and md5sum it. | ||
new_sum=$(find man -type f | sort -u | xargs cat | md5sum) | ||
|
||
# echo $orig_sum | ||
# echo $new_sum | ||
|
||
if [ "$orig_sum" != "$new_sum" ]; then | ||
echo "Your committed manual files (man/*.Rd) are out of sync with the documentation in the R files." | ||
echo "Run roxygenise() locally then commit again." | ||
exit 1 | ||
else | ||
echo "Documentation up to date." | ||
exit 0 | ||
fi |