File: proof

package info (click to toggle)
jekyll 2.2.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,908 kB
  • ctags: 687
  • sloc: ruby: 6,811; sh: 121; xml: 106; makefile: 35
file content (22 lines) | stat: -rwxr-xr-x 502 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#! /bin/bash
#
# Usage:
#   script/proof

set -e

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
}

echo "Some site files have been changed! Proofing..."

command -v htmlproof || {
    echo "Installing HTML::Proofer!"
    gem install html-proofer -- --use-system-libraries
}

bundle exec jekyll build -s site -d _site --trace
printf "\e[0;36mProofing begins now!\e[0m\n"
htmlproof ./_site