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 9d1b586 commit 9583ed8
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 @@ -48,11 +48,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 @@ -77,7 +77,7 @@ main() {
runjob prettier &
fi
if <"$CHANGED_FILES" grep -qm1 '\.\(d2\)$'; then
runjob d2 &
runjob d2fmt &
fi
waitjobs
}
Expand Down

0 comments on commit 9583ed8

Please sign in to comment.