Seed from go-template-repo, renamed to simplexcalc
The template's files at a77fd30, without its history or LICENSE, after script/rename simplexcalc. Model: opus-5-5
This commit is contained in:
Executable
+26
@@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
# script/fmt: format all files (writes). Go via gofmt, everything else
|
||||
# (markdown, CSS, JS, YAML, JSON) via prettier with the repo's
|
||||
# .prettierrc. Never hand-rolled substitutions: this script is the only
|
||||
# sanctioned way to reformat the tree.
|
||||
set -eu
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd -P)"
|
||||
ROOT="$(cd "$SCRIPT_DIR/.." && pwd -P)"
|
||||
|
||||
main() {
|
||||
cd "$ROOT"
|
||||
|
||||
gofmt -s -w .
|
||||
|
||||
if command -v goimports >/dev/null 2>&1; then
|
||||
goimports -w .
|
||||
fi
|
||||
|
||||
# A missing runner (exit 2) is a warning here: script/prettier has
|
||||
# already said so on stderr, and failing `make fmt` over it would
|
||||
# block work that has nothing to do with markdown.
|
||||
"$SCRIPT_DIR/prettier" --write . || [ $? -eq 2 ]
|
||||
}
|
||||
|
||||
main "$@"
|
||||
Reference in New Issue
Block a user