Don't output vars for normal runs, default SVG to false

This commit is contained in:
thespad 2024-11-25 13:34:50 +00:00
parent 14c304493a
commit 043d6cfdbf
No known key found for this signature in database
4 changed files with 5 additions and 3 deletions

View File

@ -10,7 +10,7 @@ If you need to test functionality just run:
```bash
docker pull lscr.io/linuxserver/d2-builder:latest && \
docker run -d --rm -v /tmp/d2:/output -e PUID=1000 -e PGID=1000 lscr.io/linuxserver/d2-builder:latest mastodon:latest
docker run -d --rm -v /tmp/d2:/output -e PUID=1000 -e PGID=1000 -e SVG=true lscr.io/linuxserver/d2-builder:latest mastodon:latest
```
Generated svg files will be created in `/output`.

View File

@ -13,7 +13,7 @@ full_custom_readme: |
```bash
docker pull lscr.io/linuxserver/d2-builder:latest && \
docker run -d --rm -v /tmp/d2:/output -e PUID=1000 -e PGID=1000 lscr.io/linuxserver/d2-builder:latest mastodon:latest
docker run -d --rm -v /tmp/d2:/output -e PUID=1000 -e PGID=1000 -e SVG=true lscr.io/linuxserver/d2-builder:latest mastodon:latest
```
Generated svg files will be created in `/output`.

View File

@ -97,6 +97,7 @@ done
shopt -s globstar
if [[ -n ${SVG} ]]; then
cat <<EOF > "/output/${OUTPUTNAME}"
vars: {
d2-config: {
@ -107,6 +108,7 @@ vars: {
}
EOF
fi
echo "\"${IMAGENAME}:${TAGNAME}\": {" >> "/output/${OUTPUTNAME}"

View File

@ -15,7 +15,7 @@ else
OUTPUTNAME="${IMAGENAME}-${TAGNAME}"
fi
if [[ -z ${RAW} ]]; then
if [[ -n ${SVG} ]]; then
s6-setuidgid abc d2 "/output/${OUTPUTNAME}.d2" "/output/${OUTPUTNAME}.svg"
chmod 644 "/output/${OUTPUTNAME}.d2" "/output/${OUTPUTNAME}.svg"
else