From 58313e67d43195fbec15a7d5fc12d7541e9a2cbe Mon Sep 17 00:00:00 2001 From: Simon Marquis Date: Sun, 16 Jun 2024 18:55:41 +0100 Subject: [PATCH] Use stdin to avoid repeating the output file name --- generateModuleGraphs.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/generateModuleGraphs.sh b/generateModuleGraphs.sh index 483ea836f..f8a0bf0d1 100755 --- a/generateModuleGraphs.sh +++ b/generateModuleGraphs.sh @@ -121,10 +121,9 @@ echo "$module_paths" | while read -r module_path; do -Pmodules.graph.output.gv="/tmp/${file_name}.gv" \ -Pmodules.graph.of.module="${module_path}" "docs/images/graphs/${file_name}.svg" - # Compress and cleanup SVG file - svgo --multipass --pretty "docs/images/graphs/${file_name}.svg" + # Convert to SVG using dot, then compress and cleanup output + dot -Tsvg "/tmp/${file_name}.gv" | + svgo --multipass --pretty --output="docs/images/graphs/${file_name}.svg" - # Remove the temporary .gv file rm "/tmp/${file_name}.gv" fi