~kris/dots

srice

ref: 9f828eb14bdd54d2c4fd8a3b2c90253021df3152 srice/.local/bin/blog-build-check -rwxr-xr-x 669 bytes
9f828eb1 — Kris Yotam mksh: backslash-escape commands in history hook to bypass module aliases (wc=tokei, tr=transmission-remote, cat=bat) 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env sh
set -eu

run_if() {
  if command -v "$1" >/dev/null 2>&1; then
    printf '\n== %s ==\n' "$*"
    "$@" || return 1
  fi
}

[ -f package.json ] && run_if npm run lint || true
[ -f package.json ] && run_if npm test || true
[ -f package.json ] && run_if npm run build || true
[ -f Makefile ] && run_if make check || true
[ -f Makefile ] && run_if make build || true
[ -f hugo.toml ] || [ -f config.toml ] && run_if hugo --printPathWarnings --printUnusedTemplates || true
[ -f _config.yml ] && run_if bundle exec jekyll build || true
run_if blog-frontmatter || true
run_if blog-future-dates || true
run_if blog-rss-check || true
run_if blog-stats || true