Skip to content

Commit

Permalink
fmt.sh: Format all d2 files
Browse files Browse the repository at this point in the history
  • Loading branch information
nhooyr committed Jan 24, 2023
1 parent 580169c commit 2bf8bd4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/fmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ trailing_whitespace() {
sh_c find . -name "'*.sedbak'" -delete
}

d2() {
d2fmt() {
if ! command -v d2 /dev/null && [ -n "${CI-}" ]; then
curl -fsSL https://d2lang.com/install.sh | sh -s --
fi
sh_c hide XARGS_N=1 xargsd "'\.\(d2\)$'" d2
sh_c hide XARGS_N=1 xargsd "'\.\(d2\)$'" d2 fmt
}

main() {
Expand All @@ -73,7 +73,7 @@ main() {
runjob trailing-whitespace trailing_whitespace &
fi
if <"$CHANGED_FILES" grep -qm1 '\.\(d2\)$'; then
runjob d2 &
runjob d2fmt &
fi
waitjobs
}
Expand Down

0 comments on commit 2bf8bd4

Please sign in to comment.