From 14f65ab9d29fdb43578724a577aa56350b043451 Mon Sep 17 00:00:00 2001 From: Daniel Freedman Date: Tue, 15 Jul 2014 18:32:15 -0400 Subject: [PATCH] Adapt to new iconset layout Remove Adobe's "save for web" nodes --- concat-svg/compile-icon-sets.sh | 9 +++++---- concat-svg/concat-svg.js | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/concat-svg/compile-icon-sets.sh b/concat-svg/compile-icon-sets.sh index 93098e664..87e823ada 100755 --- a/concat-svg/compile-icon-sets.sh +++ b/concat-svg/compile-icon-sets.sh @@ -18,7 +18,8 @@ Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt --> - + + ENDL @@ -40,10 +41,10 @@ contains() { mkdir -p iconsets NAME="icons" -FILE="iconsets/icons.html" +FILE="core-icons.html" header # find all the default icons, sort by basename (in perl), run concat -find "${DEFAULT[@]/#/$FOLDER}" -name "*24px.svg" | perl -le 'print sort{lc($p=$a)=~s|.*/||; lc($q=$b)=~s|.*/||; $p cmp $q} <>' | xargs $runfrom/concat-svg.js >> $FILE +find "${DEFAULT[@]/#/$FOLDER}" -name "*24px.svg" | perl -le 'print sort{($p=$a)=~s|.*/||; ($q=$b)=~s|.*/||; lc($p) cmp lc($q)} <>' | xargs $runfrom/concat-svg.js >> $FILE footer for dir in $FOLDER/*/; do @@ -52,7 +53,7 @@ for dir in $FOLDER/*/; do fi echo $dir NAME=`basename $dir` - FILE="iconsets/$NAME-icons.html" + FILE="$NAME-icons.html" header find $dir -name "*24px.svg" | sort | xargs $runfrom/concat-svg.js >> $FILE footer diff --git a/concat-svg/concat-svg.js b/concat-svg/concat-svg.js index 5f8e2a4a4..33f06f93f 100755 --- a/concat-svg/concat-svg.js +++ b/concat-svg/concat-svg.js @@ -27,6 +27,8 @@ function transmogrify($, name) { e.removeAttr('fill'); } }); + // remove adobe "save for web" elements + node.find('sfw,metadata').remove(); // remove empty groups var innerHTML = $.xml(node.find('*').filter(':not(g)')); // remove extraneous whitespace