Files
hash-wallet/compile_graphics.sh
T
5f04688d82 Fix compile_graphics.sh flattening subfolder SVGs (wrong Payjoin/info icons) (#3685)
* Fix compile_graphics.sh flattening subfolder SVGs into parent dirs

vector_graphics_compiler's --input-dir lists recursively and writes each
file to out-dir/<basename>.vec, so the run for res/pictures also compiled
every subfolder SVG into assets/new-ui and same-named files (payjoin.svg,
info.svg, lightning.svg) overwrote the root ones nondeterministically.
Compile only each directory's own SVGs via a temp copy.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01StzwoeTrDpPZxw5ERPaynT

* Remove explanatory comment per review

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YB4vJJnUcdupSKFD9nYpK7

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-07 16:52:30 +02:00

25 lines
773 B
Bash
Executable File

#!/usr/bin/env bash
# .svg -> .svg.vec
# to add images to the app, put .svgs in res/pictures then run this.
# compiled .svg.vec will be added to assets/new-ui
# CakeImageWidget automatically takes care of loading the compiled .vec file
# if for whatever reason you don't wanna use it, do SvgPicture(AssetBytesLoader("assets/new-ui/something.svg.vec"))
src="res/pictures"
dst="assets/new-ui"
tmp="$(mktemp -d)"
trap 'rm -rf "$tmp"' EXIT
while read -r dir; do
rel="${dir#"$src"}"
outdir="$dst$rel"
indir="$(mktemp -d "$tmp/XXXXXX")"
mkdir -p "$outdir"
find "$dir" -maxdepth 1 -type f -name '*.svg' -exec cp {} "$indir" ';'
dart run vector_graphics_compiler --input-dir "$indir" --out-dir "$outdir" >/dev/null &
done < <(find "$src" -type d)
wait