correcting generate-assets.sh script and Makefile (thanks Krytarik)

pull/549/merge^2
Set Hallstrom 2016-09-05 16:12:58 +02:00
parent 4774023b0f
commit 5635520483
2 changed files with 7 additions and 12 deletions

View File

@ -16,6 +16,7 @@ css:
$(SASS) --update $(SASSFLAGS) $(SCSS_DIR320):$(DIST_DIR320) $(SASS) --update $(SASSFLAGS) $(SCSS_DIR320):$(DIST_DIR320)
gresource: css gresource: css
scripts/generate-assets.sh
$(GLIB_COMPILE_RESOURCES) --sourcedir=$(RES_DIR) $(RES_DIR)/gtk.gresource.xml $(GLIB_COMPILE_RESOURCES) --sourcedir=$(RES_DIR) $(RES_DIR)/gtk.gresource.xml
$(GLIB_COMPILE_RESOURCES) --sourcedir=$(RES_DIR320) $(RES_DIR320)/gtk.gresource.xml $(GLIB_COMPILE_RESOURCES) --sourcedir=$(RES_DIR320) $(RES_DIR320)/gtk.gresource.xml
@ -30,6 +31,7 @@ clean:
rm -f $(RES_DIR)/gtk.gresource rm -f $(RES_DIR)/gtk.gresource
rm -rf $(DIST_DIR320) rm -rf $(DIST_DIR320)
rm -f $(RES_DIR320)/gtk.gresource rm -f $(RES_DIR320)/gtk.gresource
rm -f assets/*.png
install: all install: all
install -d -m755 $(INSTALL_DIR) install -d -m755 $(INSTALL_DIR)

View File

@ -1,16 +1,9 @@
#!/bin/bash #!/bin/bash
if [[ -z $1 ]] ; then SVGTABLE="assets/all-assets.svg"
echo "Usage: $0 [FILE]" IDPRFX="EXP-"
exit 0
else
FILENAME=$1
fi
PREFIX=EXP- for ID in $(sed -n 's/.*id="\('"$IDPRFX"'[^"]\+\)".*/\1/p' $SVGTABLE); do
echo "Generating 'assets/${ID#$IDPRFX}.png' ..."
for ID in `grep -o "id=\"$PREFIX.*\"" $FILENAME | cut -d\" -f2` ; do inkscape --without-gui --export-id=$ID --export-png=assets/${ID#$IDPRFX}.png $SVGTABLE
OUTPUT=${ID#$PREFIX}.png
echo "Exporting area $ID to $OUTPUT..."
inkscape --export-id=$ID --export-png=$OUTPUT --file=$FILENAME
done done