Script to check for JS.

This commit is contained in:
trestletech
2019-06-19 09:47:41 -05:00
parent 7c56d277da
commit 12e91ae643
3 changed files with 31 additions and 1 deletions

View File

@@ -2,6 +2,11 @@
# Generate package docs in the working directory
Rscript -e "devtools::document(roclets=c('rd', 'collate', 'namespace'))"
if [ $? -ne 0 ]
then
echo "Error generating Roxygen docs."
exit 1
fi
# This command will return a zero exit code if there are uncommitted changes
test -n "$(git status --porcelain)"

21
tools/checkJSCurrent.sh Executable file
View File

@@ -0,0 +1,21 @@
#!/bin/bash
# Run JS build process
(cd "$(dirname "$0")" && yarn build)
if [ $? -ne 0 ]
then
echo "Error generating JavaScript assets with yarn."
exit 1
fi
# This command will return a zero exit code if there are uncommitted changes
test -n "$(git status --porcelain)"
if [ $? -eq 0 ]
then
git status --porcelain
echo "Please rebuild the JavaScript and commit the changes."
echo "The above files changed when we built the JavaScript assets. This most often occurs when a user makes changes to the JavaScript sources but doesn't rebuild and commit them."
exit 1
else
echo "No difference detected; JavaScript build is current."
fi