diff --git a/script/cibuild b/script/cibuild index 58df25f3..c973b54d 100755 --- a/script/cibuild +++ b/script/cibuild @@ -2,4 +2,4 @@ script/branding script/proof -bundle exec rake +script/test diff --git a/script/proof b/script/proof index 627f1af3..767e8328 100755 --- a/script/proof +++ b/script/proof @@ -1,19 +1,20 @@ #! /bin/bash +# +# Usage: +# script/proof -# Check if any site files have changed -if [[ $(git diff --name-only origin $(git log --pretty=format:"%h" -2 | tail -1) | grep '^/site') == "" ]]; then - echo "No site files changed" - exit 0 -fi +git diff --name-only origin $(git log --pretty=format:"%h" -2 | tail -1) | grep '^/site' || { + echo "No site files changed. We'll skip proofing." + exit 0 +} -# Site files have been changed, continue -echo "Site files have been changed, proofing" -if ! [[ $(command -v htmlproof) ]]; then - echo "Installing HTML::Proofer" - gem install html-proofer -- --use-system-libraries -fi +echo "Some site files have been changed! Proofing..." -printf "\nGenerating site... " -jekyll build -s site -d _site -q -printf "done.\n\n\e[0;36mProofing begins now!\e[0m\n" +command -v htmlproof || { + echo "Installing HTML::Proofer!" + 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 diff --git a/script/test b/script/test index 78e6866a..bbd56959 100755 --- a/script/test +++ b/script/test @@ -1,11 +1,20 @@ #! /bin/bash +# +# Usage: +# script/test +# script/test -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 - TEST_FILES="test/test*.rb" + TEST_FILES="test/test_*.rb" else TEST_FILES="$@" fi +set -x + /usr/bin/env bundle exec ruby -I"lib:test" -r rake -r rake/rake_test_loader ${TEST_FILES}