From a92fe17ae0cb576f821c512d8825eabcf7aa12a2 Mon Sep 17 00:00:00 2001 From: Alfred Xing Date: Tue, 15 Jul 2014 16:27:53 -0700 Subject: [PATCH 1/4] Add script/proof to cibuild --- script/cibuild | 1 + 1 file changed, 1 insertion(+) diff --git a/script/cibuild b/script/cibuild index 9e9102b1..58df25f3 100755 --- a/script/cibuild +++ b/script/cibuild @@ -1,4 +1,5 @@ #! /bin/bash script/branding +script/proof bundle exec rake From 27f307b4285e16eef2d04bc60a4f5f1f673f49ea Mon Sep 17 00:00:00 2001 From: Alfred Xing Date: Tue, 15 Jul 2014 17:01:36 -0700 Subject: [PATCH 2/4] Proof site with html-proofer Proof site with html-proofer when the site directory is changed --- script/proof | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 script/proof diff --git a/script/proof b/script/proof new file mode 100755 index 00000000..47caa86b --- /dev/null +++ b/script/proof @@ -0,0 +1,20 @@ +#! /bin/bash + +# 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 + +# Site files have been changed, continue +echo "Site files have been changed, proofing" +if ! [[ $(command -v htmlproof) ]]; then + echo "Installing HTML::Proofer" + gem install nokogiri -- --use-system-libraries + gem install html-proofer +fi + +printf "\nGenerating site... " +jekyll build -s site -d _site -q +printf "done.\n\n\e[0;36mProofing begins now!\e[0m\n" +htmlproof ./_site From 51c7757543f639b2a7653c640ad59823ae4d7244 Mon Sep 17 00:00:00 2001 From: Alfred Xing Date: Tue, 15 Jul 2014 17:02:11 -0700 Subject: [PATCH 3/4] Uncomment the exit --- script/proof | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/proof b/script/proof index 47caa86b..a6b2c634 100755 --- a/script/proof +++ b/script/proof @@ -3,7 +3,7 @@ # 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 + exit 0 fi # Site files have been changed, continue From 10d4e023c8bffea21491c0981def72ec18204a32 Mon Sep 17 00:00:00 2001 From: Alfred Xing Date: Tue, 15 Jul 2014 17:05:59 -0700 Subject: [PATCH 4/4] Simpler way to install nokogiri with system extensions --- script/proof | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/script/proof b/script/proof index a6b2c634..627f1af3 100755 --- a/script/proof +++ b/script/proof @@ -10,8 +10,7 @@ fi echo "Site files have been changed, proofing" if ! [[ $(command -v htmlproof) ]]; then echo "Installing HTML::Proofer" - gem install nokogiri -- --use-system-libraries - gem install html-proofer + gem install html-proofer -- --use-system-libraries fi printf "\nGenerating site... "