Support raw runs with no svg generation

This commit is contained in:
thespad 2024-11-13 20:00:28 +00:00
parent e4c1ee975b
commit 492c82d3f6
No known key found for this signature in database
3 changed files with 13 additions and 10 deletions

View File

@ -22,7 +22,7 @@ docker pull lscr.io/linuxserver/d2-builder:latest && \
docker run -d --rm -v /tmp/d2:/output -v /opt/repos:/input:ro -e PUID=1000 -e PGID=1000 -e LOCAL=true lscr.io/linuxserver/d2-builder:latest mastodon:latest
```
Generated svg files will be created in `/output`.
Generated d2 and svg files will be created in `/output`. If `RAW=true` then only d2 files will be created.
## Versions

View File

@ -94,13 +94,13 @@ done
shopt -s globstar
cat <<EOF > "/output/${OUTPUTNAME}"
vars: {
d2-config: {
layout-engine: elk
theme-id: 1
dark-theme-id: 200
}
vars: {
d2-config: {
layout-engine: elk
theme-id: 1
dark-theme-id: 200
}
}
EOF

View File

@ -9,6 +9,9 @@ else
TAGNAME="latest"
fi
s6-setuidgid abc d2 "/output/${IMAGENAME}-${TAGNAME}.d2" "/output/${IMAGENAME}-${TAGNAME}.svg"
chmod 644 "/output/${IMAGENAME}-${TAGNAME}.d2" "/output/${IMAGENAME}-${TAGNAME}.svg"
if [[ -z ${RAW} ]]; then
s6-setuidgid abc d2 "/output/${IMAGENAME}-${TAGNAME}.d2" "/output/${IMAGENAME}-${TAGNAME}.svg"
chmod 644 "/output/${IMAGENAME}-${TAGNAME}.d2" "/output/${IMAGENAME}-${TAGNAME}.svg"
else
chmod 644 "/output/${IMAGENAME}-${TAGNAME}.d2"
fi