OSDN Git Service

Regular updates
[twpd/master.git] / _support / smoke_test.sh
1 #!/usr/bin/env bash
2 set -eou pipefail
3
4 exit_failure() {
5   echo 'Failed :('
6   echo ''
7   echo '  If your build failed at this point, it means'
8   echo '  the site failed to generate. Check the project'
9   echo '  out locally and try to find out why.'
10 }
11
12 trap exit_failure ERR
13
14
15 files=(
16   _site/vim.html
17   _site/react.html
18   _site/index.html
19 )
20
21 for fn in "${files[@]}"; do
22   echo ''
23   echo -n "→ Checking: $fn... "
24   test -f "$fn"
25   grep -q '<script src' "$fn"
26   grep -q 'assets/packed/app.js' "$fn"
27   grep -q 'doctype html' "$fn"
28   grep -q 'link rel="canonical"' "$fn"
29 done
30 echo ''
31 echo ''
32 echo "✓ Smoke tests good :)"