-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from terrastruct/whitespace-2eec
fmt: trailing whitespace fixes
- Loading branch information
Showing
118 changed files
with
901 additions
and
1,480 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,58 @@ | ||
#!/bin/sh | ||
set -eu | ||
. "$(dirname "$0")/../ci/sub/lib.sh" | ||
cd -- "$(dirname "$0")/.." | ||
examples=() | ||
|
||
_d2() { | ||
sh_c D2_LAYOUT=tala hide d2 ./src/examples/"$ex"/syntax/d2.d2 ./src/examples/"$ex"/render/d2_tala.svg | ||
sh_c D2_LAYOUT=dagre hide d2 ./src/examples/"$ex"/syntax/d2.d2 ./src/examples/"$ex"/render/d2_dagre.svg | ||
sh_c D2_LAYOUT=elk hide d2 ./src/examples/"$ex"/syntax/d2.d2 ./src/examples/"$ex"/render/d2_elk.svg | ||
} | ||
|
||
if [ -z "$1" ] | ||
then | ||
# Rendering for all examples | ||
search_dir=./src/examples | ||
for f in "$search_dir"/* | ||
do | ||
filename=$(basename -- "$f") | ||
examples+=("$filename") | ||
mmdc() { | ||
config=$(mktempd)/mmdc-config | ||
echo '{"deterministicIds": true}' >$config | ||
npx --package @mermaid-js/[email protected] -- mmdc -c"$config" "$@" | ||
} | ||
|
||
_mmdc() { | ||
sh_c mmdc -i ./src/examples/"$ex"/syntax/mermaid.mmd -o ./src/examples/"$ex"/render/mermaid_dagre.svg | ||
} | ||
|
||
_dot() { | ||
sh_c dot -Tsvg ./src/examples/"$ex"/syntax/graphviz.dot >src/examples/"$ex"/render/graphviz_dot.svg | ||
sh_c dot -Kneato -Tsvg ./src/examples/"$ex"/syntax/graphviz.dot >src/examples/"$ex"/render/graphviz_neato.svg | ||
} | ||
|
||
_plantuml() { | ||
sh_c plantuml -Tsvg ./src/examples/"$ex"/syntax/plantuml.puml -o ../render | ||
mv ./src/examples/"$ex"/render/plantuml.svg ./src/examples/"$ex"/render/plantuml_dot.svg | ||
} | ||
|
||
main() { | ||
job_parseflags "$@" | ||
for ex in $(find ./src/examples -mindepth 1 -maxdepth 1 | sort -V); do | ||
ex=${ex#./src/examples/} | ||
export JOBNAME=$ex | ||
if ! _runjob_filter; then | ||
continue | ||
fi | ||
|
||
bigheader "$ex" | ||
if [ -f ./src/examples/"$ex"/syntax/d2.d2 ]; then | ||
runjob _d2 & | ||
fi | ||
if [ -f ./src/examples/"$ex"/syntax/mermaid.mmd ]; then | ||
runjob _mmdc & | ||
fi | ||
if [ -f ./src/examples/"$ex"/syntax/graphviz.dot ]; then | ||
[ "$ex" != 8_text ] && runjob _dot & | ||
fi | ||
if [ -f ./src/examples/"$ex"/syntax/plantuml.puml ]; then | ||
runjob _plantuml & | ||
fi | ||
waitjobs | ||
done | ||
else | ||
# Rendering for a specific example | ||
examples+=($1) | ||
fi | ||
|
||
for ex in ${examples[@]} | ||
do | ||
D2_LAYOUT=tala d2 src/examples/$ex/syntax/d2 src/examples/$ex/render/d2_tala.svg | ||
D2_LAYOUT=dagre d2 src/examples/$ex/syntax/d2 src/examples/$ex/render/d2_dagre.svg | ||
D2_LAYOUT=elk d2 src/examples/$ex/syntax/d2 src/examples/$ex/render/d2_elk.svg | ||
mmdc -i src/examples/$ex/syntax/mermaid -o src/examples/$ex/render/mermaid_dagre.svg | ||
dot -Tsvg src/examples/$ex/syntax/graphviz > src/examples/$ex/render/graphviz_dot.svg | ||
dot -Kneato -Tsvg src/examples/$ex/syntax/graphviz > src/examples/$ex/render/graphviz_neato.svg | ||
plantuml -Tsvg src/examples/$ex/syntax/plantuml -o ../render | ||
mv src/examples/$ex/render/plantuml.svg src/examples/$ex/render/plantuml_dot.svg | ||
done | ||
} | ||
|
||
main "$@" |
Submodule sub
updated
6 files
+3 −3 | examples/date.sh | |
+54 −8 | lib.sh | |
+8 −1 | lib/job.sh | |
+1 −1 | lib/log.sh | |
+1 −6 | lib/misc.sh | |
+46 −0 | lib/ssh.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.