diff options
author | Lars Wirzenius <liw@liw.fi> | 2020-09-05 14:42:08 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2020-09-05 18:31:23 +0300 |
commit | 33683712604607d85f20cbf93a7ac904552f4979 (patch) | |
tree | fc37020f3b0c8220e096c33d4f63008a612174c9 /check | |
parent | bddb592c4cb89e76796b17dd5bed823eba7e2b0e (diff) | |
download | jt2-33683712604607d85f20cbf93a7ac904552f4979.tar.gz |
feat: create and initialise a new journal
At the moment this only creates a new directory, but most of the
change is scaffolding so that more interesting changes can be built on
top of this later.
Diffstat (limited to 'check')
-rwxr-xr-x | check | 63 |
1 files changed, 63 insertions, 0 deletions
@@ -0,0 +1,63 @@ +#!/bin/sh + +set -eu + +verbose=false +if [ "$#" -gt 0 ] +then + case "$1" in + verbose | -v | --verbose) + verbose=true + ;; + esac +fi + +hideok= + +if command -v chronic > /dev/null +then + hideok=chronic +fi + +if $verbose +then + hideok= +fi + + +codegen() { + $hideok sp-codegen "$1" --output "$2" --run +} + +docgen() { + $hideok sp-docgen "$1" --output "$2" +} + +$hideok cargo build --all-targets +if cargo --list | awk '{ print $1 }' | grep 'clippy$' > /dev/null +then + $hideok cargo clippy +fi +$hideok cargo test + +if command -v rustfmt > /dev/null +then + find src -type f -name '*.rs' -exec rustfmt --check '{}' + +fi + +if command -v black > /dev/null +then + $hideok find . -type f -name '*.py' ! -name template.py ! -name test.py \ + -exec black --check '{}' + +fi + +for md in [^CR]*.md +do + $hideok echo "$md =====================================" + codegen "$md" test.py + docgen "$md" "$(basename "$md" .md).pdf" + docgen "$md" "$(basename "$md" .md).html" + $hideok echo +done + +echo "Everything seems to be in order." |