Skip to content

Commit

Permalink
Minor tweak to generate.sh to handle spaces in component names (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
kbx81 authored Oct 7, 2024
1 parent fc721f4 commit a76628a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ basedir=$(dirname "$0")

text="component-text"

sed s/COMPONENT/$name/ <$basedir/template.svg >/tmp/$lower_name.svg
# Convert underscores to spaces in generated image text
name="${name//_/ }"
sed "s/COMPONENT/$name/" <$basedir/template.svg >/tmp/$lower_name.svg

width=$(inkscape --actions="select-by-id:$text; query-width;" /tmp/$lower_name.svg 2>/dev/null)
width=$(printf '%.*f' 0 $width)
Expand Down

0 comments on commit a76628a

Please sign in to comment.