Cleaning up the cibuild stuff.

This commit is contained in:
Parker Moore 2014-07-15 21:53:50 -04:00
parent 9d07a97945
commit ab66326f97
3 changed files with 27 additions and 17 deletions

View File

@ -2,4 +2,4 @@
script/branding script/branding
script/proof script/proof
bundle exec rake script/test

View File

@ -1,19 +1,20 @@
#! /bin/bash #! /bin/bash
#
# Usage:
# script/proof
# Check if any site files have changed git diff --name-only origin $(git log --pretty=format:"%h" -2 | tail -1) | grep '^/site' || {
if [[ $(git diff --name-only origin $(git log --pretty=format:"%h" -2 | tail -1) | grep '^/site') == "" ]]; then echo "No site files changed. We'll skip proofing."
echo "No site files changed" exit 0
exit 0 }
fi
# Site files have been changed, continue echo "Some site files have been changed! Proofing..."
echo "Site files have been changed, proofing"
if ! [[ $(command -v htmlproof) ]]; then
echo "Installing HTML::Proofer"
gem install html-proofer -- --use-system-libraries
fi
printf "\nGenerating site... " command -v htmlproof || {
jekyll build -s site -d _site -q echo "Installing HTML::Proofer!"
printf "done.\n\n\e[0;36mProofing begins now!\e[0m\n" gem install html-proofer -- --use-system-libraries
}
jekyll build -s site -d _site --trace
echo -e "\e[0;36mProofing begins now!\e[0m\n"
htmlproof ./_site htmlproof ./_site

View File

@ -1,11 +1,20 @@
#! /bin/bash #! /bin/bash
#
# Usage:
# script/test
# script/test <hi>
set -x git diff --name-only origin $(git log --pretty=format:"%h" -2 | tail -1) | grep -v '^/site' || {
echo "No lib files have changed, skipping Jekyll tests!"
exit 0
}
if [ -z "$1" ]; then if [ -z "$1" ]; then
TEST_FILES="test/test*.rb" TEST_FILES="test/test_*.rb"
else else
TEST_FILES="$@" TEST_FILES="$@"
fi fi
set -x
/usr/bin/env bundle exec ruby -I"lib:test" -r rake -r rake/rake_test_loader ${TEST_FILES} /usr/bin/env bundle exec ruby -I"lib:test" -r rake -r rake/rake_test_loader ${TEST_FILES}